index.vue 8.9 KB

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