index.vue 9.6 KB

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