index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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. onLoad() {
  150. console.log(this.$store)
  151. console.log(this.hasLogin)
  152. console.log(this.userInfo)
  153. if(this.successlogion && this.hasLogin) {
  154. this.getuserinfo();
  155. }else {
  156. uni.navigateTo({
  157. url: './logion'
  158. })
  159. //this.showdialog = true;
  160. }
  161. },
  162. watch:{
  163. 'hasLogin':function(val) {
  164. if(val) {
  165. this.getuserinfo();
  166. }else {
  167. uni.navigateTo({
  168. url: './logion'
  169. })
  170. }
  171. },
  172. 'successlogion':function(val) {
  173. if(val) {
  174. this.getuserinfo();
  175. }else {
  176. uni.navigateTo({
  177. url: './logion'
  178. })
  179. }
  180. },
  181. },
  182. methods: {
  183. // 跳转到我的订单
  184. gomyorder(e) {
  185. if(this.successlogion && this.hasLogin) {
  186. let state = '';
  187. if(e == 0) {
  188. state = 'all';
  189. uni.navigateTo({
  190. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  191. })
  192. }else if(e == 1) {
  193. state = 'waiting';
  194. uni.navigateTo({
  195. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  196. })
  197. }else if(e == 2) {
  198. state = 'payed';
  199. uni.navigateTo({
  200. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  201. })
  202. }else if(e == 3) {
  203. state = 'complete';
  204. uni.navigateTo({
  205. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  206. })
  207. }else if(e == 4) {
  208. state = 'cancel';
  209. uni.navigateTo({
  210. url: `/pages/myCenter/orderdetail?state=${state}` // 我的消息通知
  211. })
  212. }else if(e == 5) {
  213. state = 'refund';
  214. uni.navigateTo({
  215. url: '/pages/myOrder/refuend' // 我的消息通知
  216. });
  217. }
  218. }else {
  219. uni.navigateTo({
  220. url: './logion'
  221. })
  222. }
  223. },
  224. getuserinfo() {
  225. this.request({
  226. url:'/v2/member/info',
  227. method:'GET',
  228. success: (res)=>{
  229. let { data } = res.data;
  230. // userinfo
  231. this.menberinfo = data;
  232. this.member_points =data.member_points
  233. }
  234. })
  235. },
  236. // // 关闭弹窗
  237. // cancelDiaolog() {
  238. // this.showdialog = false;
  239. // },
  240. // // 确定
  241. // confirmDiaolog() {
  242. // this.showdialog = false;
  243. // },
  244. // changeDiaolog() {
  245. // this.showdialog = false;
  246. // },
  247. // keepdialog() {
  248. // this.showdialog = true;
  249. // },
  250. // 签到
  251. writeday() {
  252. this.request({
  253. url: '/v1/member/point',
  254. method: 'POST',
  255. data: {
  256. stage: 'sign'
  257. },
  258. success: (res) => {
  259. if(res.data.code == 1000) {
  260. this.$msg("签到成功")
  261. }
  262. this.getuserinfo();
  263. }
  264. })
  265. },
  266. iswriteday() {
  267. this.$msg("今天已经签过到")
  268. },
  269. goAdress(e) {
  270. if(this.successlogion && this.hasLogin) {
  271. if(e == 1) {
  272. let a = 1;
  273. uni.navigateTo({
  274. url: `/pages/myOrder/adress?isform=${a}` // 我的地址
  275. })
  276. }else if(e == 0) {
  277. uni.navigateTo({
  278. url: './applyfor' // 我的申请
  279. })
  280. }else if(e == 2) {
  281. uni.navigateTo({
  282. url: './Settled' // 酒店入驻
  283. })
  284. }else if(e == 3) {
  285. uni.navigateTo({
  286. url: './definite' // 圈币明细
  287. })
  288. }else if(e == 7) {
  289. uni.navigateTo({
  290. url: './business' // 商务合作
  291. })
  292. }else if(e == 8) {
  293. uni.navigateTo({
  294. url: './commentback' // 意见反馈
  295. })
  296. }else if(e == 9) {
  297. uni.navigateTo({
  298. url: './myCollect' // 我的收藏
  299. })
  300. }
  301. }else {
  302. uni.navigateTo({
  303. url: './logion'
  304. })
  305. //this.showdialog = true;
  306. }
  307. },
  308. goinfor() {
  309. if(this.successlogion && this.hasLogin) {
  310. uni.navigateTo({
  311. url: './information' // 我的xiaoxi
  312. })
  313. }else {
  314. uni.navigateTo({
  315. url: './logion'
  316. })
  317. // this.showdialog = true;
  318. }
  319. }
  320. }
  321. }
  322. </script>
  323. <style lang="scss">
  324. .myBox {
  325. height: 100vh;
  326. width: 100%;
  327. background-color: #fff;
  328. .myhead {
  329. height: 290upx;
  330. background-color: #D9332E;
  331. .myheadImg {
  332. padding: 10upx 32upx 0 0;
  333. height: 85upx;
  334. text-align: right;
  335. line-height: 85upx;
  336. }
  337. .myNmae {
  338. display: flex;
  339. justify-content: space-between;
  340. flex-direction: row;
  341. align-items: center;
  342. padding: 20upx 32upx 0 32upx;
  343. .myNmaeLeft {
  344. display: flex;
  345. flex-direction: row;
  346. align-items: center;
  347. color: #fff;
  348. .myNmaeImg {
  349. width: 128upx;
  350. height: 128upx;
  351. border-radius: 50%;
  352. padding-right: 32upx;
  353. image {
  354. width: 100%;
  355. height: 100%;
  356. border-radius: 50%;
  357. background-color: #fff;
  358. }
  359. }
  360. }
  361. .myNmaeRight {
  362. width:144upx;
  363. height: 52upx;
  364. background:rgba(255,255,255,0.27);
  365. border-radius: 44upx;
  366. border:2upx solid rgb(255,255,255);
  367. color: #fff;
  368. line-height: 52upx;
  369. text-align: center;
  370. font-size: 24upx;;
  371. }
  372. }
  373. }
  374. .myorder {
  375. padding: 0 32upx;
  376. .orderList {
  377. padding: 28upx 0;
  378. display: flex;
  379. }
  380. .orderOne {
  381. flex: 1;
  382. flex-direction: column;
  383. text-align: center;
  384. .imagewidth {
  385. width: 44upx;
  386. height: 44upx;
  387. }
  388. }
  389. }
  390. }
  391. </style>