index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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" 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 title="我的订单" is-link />
  22. <view class="myorder">
  23. <view class="orderList">
  24. <view class="orderOne">
  25. <image class="imagewidth" src=""></image>
  26. <view>待付款</view>
  27. </view>
  28. <view class="orderOne">
  29. <image class="imagewidth" src=""></image>
  30. <view>处理中</view>
  31. </view>
  32. <view class="orderOne">
  33. <image class="imagewidth" src=""></image>
  34. <view>带评价</view>
  35. </view>
  36. <view class="orderOne">
  37. <image class="imagewidth" src=""></image>
  38. <view>已取消</view>
  39. </view>
  40. <view class="orderOne">
  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. getuserinfo() {
  166. this.request({
  167. url:'/v2/member/info',
  168. method:'GET',
  169. success: (res)=>{
  170. let { data } = res.data;
  171. console.log(data);
  172. this.userinfo = data;
  173. }
  174. })
  175. },
  176. // // 关闭弹窗
  177. // cancelDiaolog() {
  178. // this.showdialog = false;
  179. // },
  180. // // 确定
  181. // confirmDiaolog() {
  182. // this.showdialog = false;
  183. // },
  184. // changeDiaolog() {
  185. // this.showdialog = false;
  186. // },
  187. // keepdialog() {
  188. // this.showdialog = true;
  189. // },
  190. goAdress(e) {
  191. console.log(this.hasLogin)
  192. console.log(e);
  193. if(this.hasLogin) {
  194. if(e == 1) {
  195. uni.navigateTo({
  196. url: '../myOrder/adress' // 我的地址
  197. })
  198. }else if(e == 0) {
  199. uni.navigateTo({
  200. url: './applyfor' // 我的申请
  201. })
  202. }else if(e == 2) {
  203. uni.navigateTo({
  204. url: './Settled' // 酒店入驻
  205. })
  206. }else if(e == 3) {
  207. uni.navigateTo({
  208. url: './definite' // 圈币明细
  209. })
  210. }else if(e == 7) {
  211. uni.navigateTo({
  212. url: './business' // 商务合作
  213. })
  214. }else if(e == 8) {
  215. uni.navigateTo({
  216. url: './commentback' // 意见反馈
  217. })
  218. }else if(e == 9) {
  219. uni.navigateTo({
  220. url: './myCollect' // 我的收藏
  221. })
  222. }
  223. }else {
  224. uni.navigateTo({
  225. url: './logion'
  226. })
  227. //this.showdialog = true;
  228. }
  229. },
  230. goinfor() {
  231. if(this.hasLogin) {
  232. uni.navigateTo({
  233. url: './information' // 我的xiaoxi
  234. })
  235. }else {
  236. uni.navigateTo({
  237. url: './logion'
  238. })
  239. // this.showdialog = true;
  240. }
  241. }
  242. }
  243. }
  244. </script>
  245. <style lang="scss">
  246. .myBox {
  247. height: 100vh;
  248. width: 100%;
  249. background-color: #fff;
  250. .myhead {
  251. height: 290upx;
  252. background-color: #D9332E;
  253. .myheadImg {
  254. padding: 10upx 32upx 0 0;
  255. height: 85upx;
  256. text-align: right;
  257. line-height: 85upx;
  258. }
  259. .myNmae {
  260. display: flex;
  261. justify-content: space-between;
  262. flex-direction: row;
  263. align-items: center;
  264. padding: 20upx 32upx 0 32upx;
  265. .myNmaeLeft {
  266. display: flex;
  267. flex-direction: row;
  268. align-items: center;
  269. color: #fff;
  270. .myNmaeImg {
  271. width: 128upx;
  272. height: 128upx;
  273. border-radius: 50%;
  274. padding-right: 32upx;
  275. image {
  276. width: 100%;
  277. height: 100%;
  278. border-radius: 50%;
  279. background-color: #fff;
  280. }
  281. }
  282. }
  283. .myNmaeRight {
  284. width:144upx;
  285. height: 52upx;
  286. background:rgba(255,255,255,0.27);
  287. border-radius: 44upx;
  288. border:2upx solid rgb(255,255,255);
  289. color: #fff;
  290. line-height: 52upx;
  291. text-align: center;
  292. font-size: 24upx;;
  293. }
  294. }
  295. }
  296. .myorder {
  297. padding: 0 32upx;
  298. .orderList {
  299. padding: 28upx 0;
  300. display: flex;
  301. }
  302. .orderOne {
  303. flex: 1;
  304. flex-direction: column;
  305. text-align: center;
  306. .imagewidth {
  307. width: 44upx;
  308. height: 44upx;
  309. background-color: red;
  310. }
  311. }
  312. }
  313. }
  314. </style>