index.vue 8.4 KB

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