index.vue 9.7 KB

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