index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <view class="myBox">
  3. <view class="myhead">
  4. <view @click="goinfor" class="myheadImg">
  5. <uni-icon color="#fff" size="22" type="chat"></uni-icon>
  6. </view>
  7. <view class="myNmae">
  8. <view class="myNmaeLeft">
  9. <view class="myNmaeImg" v-if="successlogion&&hasLogin || !successlogion && hasLogin">
  10. <image :src="userInfo.avatarUrl"></image>
  11. </view>
  12. <view class="myNmaeImg" v-if="!successlogion && !hasLogin|| successlogion && !hasLogin">
  13. <image src=""></image>
  14. </view>
  15. <view v-if="successlogion&&hasLogin">
  16. <view style="font-size: 34upx;margin-bottom: 32upx;">{{userInfo.nickName}}</view>
  17. <view style="font-size: 24upx" @click="goAdress(3)" >圈币{{member_points}}></view>
  18. </view>
  19. <view v-if="!successlogion && hasLogin">
  20. <view style="font-size: 34upx;margin-bottom: 32upx;">{{userInfo.nickName}}</view>
  21. <view style="font-size: 24upx" @click="goAdress(3)" >请绑定手机号></view>
  22. </view>
  23. <view v-if="!successlogion && !hasLogin|| successlogion && !hasLogin">
  24. <view style="font-size: 34upx;margin-bottom: 32upx;" @click="goAdress(3)">请登录</view>
  25. <view style="font-size: 24upx" @click="goAdress(3)" >圈币***></view>
  26. </view>
  27. </view>
  28. <view class="myNmaeRight" @click="writeday" v-if="menberinfo.has_sign == 0">每日签到></view>
  29. <view class="myNmaeRight" @click="iswriteday" v-if="menberinfo.has_sign == 1">您已签到</view>
  30. </view>
  31. </view>
  32. <van-cell @click="gomyorder(0)" title="我的订单" is-link />
  33. <view class="myorder">
  34. <view class="orderList">
  35. <view class="orderOne" @click="gomyorder(1)">
  36. <image class="imagewidth" src="../../static/order_wat_pay.png" ></image>
  37. <view>待付款</view>
  38. <block v-if="num.waiting_count>0">
  39. <text v-if="num.waiting_count<=99">{{num.waiting_count}}</text>
  40. <text v-else>99+</text>
  41. </block>
  42. </view>
  43. <view class="orderOne" @click="gomyorder(2)">
  44. <image class="imagewidth" src="../../static/order_handle.png"></image>
  45. <view>处理中</view>
  46. <block v-if="num.payed_count>0">
  47. <text v-if="num.payed_count<=99">{{num.payed_count}}</text>
  48. <text v-else>99+</text>
  49. </block>
  50. </view>
  51. <view class="orderOne" @click="gomyorder(3)">
  52. <image class="imagewidth" src="../../static/order_comment.png"></image>
  53. <view>已收货</view>
  54. </view>
  55. <view class="orderOne" @click="gomyorder(4)">
  56. <image class="imagewidth" src="../../static/order_cancel.png"></image>
  57. <view>已取消</view>
  58. </view>
  59. <view class="orderOne" @click="gomyorder(5)">
  60. <image class="imagewidth" src="../../static/order_wat_pay.png"></image>
  61. <view>退款/售后</view>
  62. </view>
  63. </view>
  64. </view>
  65. <view style="border-bottom: 20upx solid #F5F5F5;"></view>
  66. <van-cell title="我的服务"/>
  67. <van-cell @click="goAdress(0)" title="圈在网代理" is-link>
  68. <template slot="icon">
  69. <image style="width: 29upx;height: 29upx;
  70. margin-right: 8upx;
  71. vertical-align:middle"
  72. src="../../static/ab.png" />
  73. </template>
  74. </van-cell>
  75. <van-cell @click="goAdress(2)" title="圈在网入驻" is-link>
  76. <template slot="icon">
  77. <image style="width: 33upx;height: 33upx;
  78. margin-right: 8upx;
  79. vertical-align:middle"
  80. src="../../static/bb.png" />
  81. </template>
  82. </van-cell>
  83. <van-cell @click="goAdress(3)" title="圈币明细" is-link>
  84. <template slot="icon">
  85. <image style="width: 29upx;height: 29upx;
  86. margin-right: 8upx;
  87. vertical-align:middle"
  88. src="../../static/exchange.png" />
  89. </template>
  90. </van-cell>
  91. <van-cell @click="goAdress(1)" title="我的地址" is-link>
  92. <template slot="icon">
  93. <image style="width: 29upx;height: 29upx;
  94. margin-right: 8upx;
  95. vertical-align:middle"
  96. src="../../static/local.png" />
  97. </template>
  98. </van-cell>
  99. <van-cell @click="goAdress(9)" title="我的收藏" is-link>
  100. <template slot="icon">
  101. <image style="width: 29upx;height: 29upx;
  102. margin-right: 8upx;
  103. vertical-align:middle"
  104. src="../../static/favorite.png" />
  105. </template>
  106. </van-cell>
  107. <van-cell @click="goAdress(8)" title="意见反馈" is-link>
  108. <template slot="icon">
  109. <image style="width: 29upx;height: 29upx;
  110. margin-right: 8upx;
  111. vertical-align:middle"
  112. src="../../static/service.png" />
  113. </template>
  114. </van-cell>
  115. <van-cell @click="goAdress(7)" title="商务合作" is-link>
  116. <template slot="icon">
  117. <image style="width: 29upx;height: 29upx;
  118. margin-right: 8upx;
  119. vertical-align:middle"
  120. src="../../static/setting.png" />
  121. </template>
  122. </van-cell>
  123. </view>
  124. </template>
  125. <script>
  126. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  127. import logionDialog from '@/component/loginDialog.vue'
  128. import {
  129. mapMutations,mapState
  130. } from 'vuex'
  131. export default {
  132. components: {
  133. uniIcon,
  134. logionDialog
  135. },
  136. data() {
  137. return {
  138. member_points: 0,
  139. showdialog: false,
  140. ishow: false,
  141. menberinfo: {},
  142. num:{},//我的订单数量统计
  143. }
  144. },
  145. computed:{
  146. ...mapState([
  147. 'hasLogin',
  148. 'successlogion',
  149. 'getcode',
  150. 'userInfo'
  151. ]),
  152. },
  153. onShow() {
  154. this.getuserinfo();
  155. this.getNum();
  156. },
  157. onLoad() {
  158. if(this.successlogion && this.hasLogin) {
  159. this.getuserinfo();
  160. }else {
  161. uni.navigateTo({
  162. url: './logion'
  163. })
  164. //this.showdialog = true;
  165. }
  166. },
  167. watch:{
  168. 'hasLogin':function(val) {
  169. if(val) {
  170. this.getuserinfo();
  171. }else {
  172. uni.navigateTo({
  173. url: './logion'
  174. })
  175. }
  176. },
  177. 'successlogion':function(val) {
  178. if(val) {
  179. this.getuserinfo();
  180. }else {
  181. uni.navigateTo({
  182. url: './logion'
  183. })
  184. }
  185. },
  186. },
  187. methods: {
  188. // 跳转到我的订单
  189. gomyorder(e) {
  190. if(this.successlogion && this.hasLogin) {
  191. let state = '';
  192. if(e == 0) {
  193. state = 'all';
  194. uni.navigateTo({
  195. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  196. })
  197. }else if(e == 1) {
  198. state = 'waiting';
  199. uni.navigateTo({
  200. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  201. })
  202. }else if(e == 2) {
  203. state = 'payed';
  204. uni.navigateTo({
  205. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  206. })
  207. }else if(e == 3) {
  208. state = 'complete';
  209. uni.navigateTo({
  210. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  211. })
  212. }else if(e == 4) {
  213. state = 'cancel';
  214. uni.navigateTo({
  215. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  216. })
  217. }else if(e == 5) {
  218. state = 'refund';
  219. uni.navigateTo({
  220. url: '/pages/myOrder/refuend' // 我的消息通知
  221. });
  222. }
  223. }else {
  224. uni.navigateTo({
  225. url: './logion'
  226. })
  227. }
  228. },
  229. getuserinfo() {
  230. this.request({
  231. url:'/v2/member/info',
  232. method:'GET',
  233. success: (res)=>{
  234. let { data } = res.data;
  235. // userinfo
  236. this.menberinfo = data;
  237. this.member_points =data.member_points
  238. }
  239. })
  240. },
  241. getNum(){
  242. this.request({
  243. url:'/v1/order/statistics',
  244. method:'GET',
  245. success: (res)=>{
  246. this.num=res.data.data
  247. }
  248. })
  249. },
  250. // // 关闭弹窗
  251. // cancelDiaolog() {
  252. // this.showdialog = false;
  253. // },
  254. // // 确定
  255. // confirmDiaolog() {
  256. // this.showdialog = false;
  257. // },
  258. // changeDiaolog() {
  259. // this.showdialog = false;
  260. // },
  261. // keepdialog() {
  262. // this.showdialog = true;
  263. // },
  264. // 签到
  265. writeday() {
  266. this.request({
  267. url: '/v1/member/point',
  268. method: 'POST',
  269. data: {
  270. stage: 'sign'
  271. },
  272. success: (res) => {
  273. if(res.data.code == 1000) {
  274. this.$msg("签到成功")
  275. }
  276. this.getuserinfo();
  277. }
  278. })
  279. },
  280. iswriteday() {
  281. this.$msg("今天已经签过到")
  282. },
  283. goAdress(e) {
  284. if(this.successlogion && this.hasLogin) {
  285. if(e == 1) {
  286. let a = 1;
  287. uni.navigateTo({
  288. url: `/pages/myOrder/adress?isform=${a}` // 我的地址
  289. })
  290. }else if(e == 0) {
  291. uni.navigateTo({
  292. url: './applyfor' // 我的申请
  293. })
  294. }else if(e == 2) {
  295. uni.navigateTo({
  296. url: './Settled' // 酒店入驻
  297. })
  298. }else if(e == 3) {
  299. uni.navigateTo({
  300. url: './definite' // 圈币明细
  301. })
  302. }else if(e == 7) {
  303. uni.navigateTo({
  304. url: './business' // 商务合作
  305. })
  306. }else if(e == 8) {
  307. uni.navigateTo({
  308. url: './commentback' // 意见反馈
  309. })
  310. }else if(e == 9) {
  311. uni.navigateTo({
  312. url: './myCollect' // 我的收藏
  313. })
  314. }
  315. }else {
  316. uni.navigateTo({
  317. url: './logion'
  318. })
  319. //this.showdialog = true;
  320. }
  321. },
  322. goinfor() {
  323. if(this.successlogion && this.hasLogin) {
  324. uni.navigateTo({
  325. url: './information' // 我的xiaoxi
  326. })
  327. }else {
  328. uni.navigateTo({
  329. url: './logion'
  330. })
  331. // this.showdialog = true;
  332. }
  333. }
  334. }
  335. }
  336. </script>
  337. <style lang="scss">
  338. .myBox {
  339. height: 100vh;
  340. width: 100%;
  341. background-color: #fff;
  342. .myhead {
  343. height: 290upx;
  344. background-color: #D9332E;
  345. .myheadImg {
  346. padding: 10upx 32upx 0 0;
  347. height: 85upx;
  348. text-align: right;
  349. line-height: 85upx;
  350. }
  351. .myNmae {
  352. display: flex;
  353. justify-content: space-between;
  354. flex-direction: row;
  355. align-items: center;
  356. padding: 20upx 32upx 0 32upx;
  357. .myNmaeLeft {
  358. display: flex;
  359. flex-direction: row;
  360. align-items: center;
  361. color: #fff;
  362. .myNmaeImg {
  363. width: 128upx;
  364. height: 128upx;
  365. border-radius: 50%;
  366. padding-right: 32upx;
  367. image {
  368. width: 100%;
  369. height: 100%;
  370. border-radius: 50%;
  371. background-color: #fff;
  372. }
  373. }
  374. }
  375. .myNmaeRight {
  376. width:144upx;
  377. height: 52upx;
  378. background:rgba(255,255,255,0.27);
  379. border-radius: 44upx;
  380. border:2upx solid rgb(255,255,255);
  381. color: #fff;
  382. line-height: 52upx;
  383. text-align: center;
  384. font-size: 24upx;;
  385. }
  386. }
  387. }
  388. .myorder {
  389. padding: 0 32upx;
  390. .orderList {
  391. padding: 28upx 0;
  392. display: flex;
  393. }
  394. .orderOne {
  395. flex: 1;
  396. flex-direction: column;
  397. text-align: center;
  398. position: relative;
  399. .imagewidth {
  400. width: 44upx;
  401. height: 44upx;
  402. }
  403. text{
  404. position: absolute;
  405. font-size: 20upx;
  406. color: #fff;
  407. background-color: #D9332E;
  408. border-radius: 50upx;
  409. top: 0;
  410. right: -10upx;
  411. padding: 0 4upx;
  412. box-sizing: border-box;
  413. white-space: nowrap;
  414. text-align: center;
  415. min-width:30upx;
  416. }
  417. }
  418. }
  419. }
  420. </style>