index.vue 10 KB

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