setting.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view>
  3. <!-- 设置 -->
  4. <u-card :border="false" padding="30" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
  5. :show-head="false" @click="tishi">
  6. <view slot="body">
  7. <view class="u-flex u-row-between">
  8. <view class="">
  9. <u-image width="130rpx" height="130rpx" :src="userInfo.storeImageUrl" :lazy-load="true" shape="circle">
  10. <view slot="error" style="font-size: 24rpx" :fade="true" duration="450">加载失败
  11. </view>
  12. </u-image>
  13. </view>
  14. <view class="u-flex">
  15. <view class="u-m-r-50" style="color: #0d79ec; font-size: 32rpx">修改头像</view>
  16. <u-icon name="arrow-right" color="#0D79EC" size="28"></u-icon>
  17. </view>
  18. </view>
  19. </view>
  20. </u-card>
  21. <u-card :border="false" padding="20" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
  22. :show-head="false">
  23. <view slot="body">
  24. <template>
  25. <u-cell-group :border="false">
  26. <u-cell-item title="收货地址管理" @click="tishi">
  27. <u-icon slot="icon" size="42" name="location-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  28. </u-cell-item>
  29. <u-cell-item title="门店名称" :value="userInfo.storeName" :arrow="false">
  30. <u-icon slot="icon" size="42" name="shop-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  31. </u-cell-item>
  32. <u-cell-item title="门店联系人" :value="userInfo.contactName" :arrow="false">
  33. <u-icon slot="icon" size="42" name="contact" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  34. </u-cell-item>
  35. <u-cell-item title="联系电话" :value="userInfo.storePhone" :arrow="false">
  36. <u-icon slot="icon" size="42" name="phone-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  37. </u-cell-item>
  38. <u-cell-item title="用户协议">
  39. <u-icon slot="icon" size="42" name="friends-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  40. </u-cell-item>
  41. <u-cell-item title="隐私政策">
  42. <u-icon slot="icon" size="42" name="info-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  43. </u-cell-item>
  44. <u-cell-item title="版本检测" :value="edition_s" :arrow="false" :border-bottom="false" @click="edition">
  45. <u-icon slot="icon" size="42" name="setting-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  46. </u-cell-item>
  47. </u-cell-group>
  48. </template>
  49. </view>
  50. </u-card>
  51. <u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
  52. </view>
  53. </template>
  54. <script>
  55. import {
  56. mapMutations
  57. } from "vuex";
  58. import {
  59. request
  60. } from "../../../common/request/request";
  61. require("promise.prototype.finally").shim();
  62. export default {
  63. data() {
  64. return {
  65. userInfo: {},
  66. edition_s: ''
  67. };
  68. },
  69. created() {
  70. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  71. console.log(wgtinfo);
  72. console.log(wgtinfo.version); //版本号
  73. this.edition_s = wgtinfo.version
  74. })
  75. this.getMyinfo();
  76. },
  77. methods: {
  78. ...mapMutations(["logout"]),
  79. exit() {
  80. this.logout();
  81. this.$u.route({
  82. url: "pages/login/index",
  83. type: "reLaunch",
  84. });
  85. },
  86. edition() {
  87. request({
  88. url: '/baseReq/apkUpgrade',
  89. method: 'get',
  90. params: {
  91. osType: 0
  92. }
  93. }).then(res => {
  94. console.log(res)
  95. console.log(res.data.forceVersion) //最低版本
  96. console.log(res.data.msg) //更新文案
  97. console.log(res.data.url) //下载最新版地址
  98. console.log(res.data.version) //最新版本
  99. if (this.edition_s == res.data.forceVersion) {
  100. console.log("已满足最低版本")
  101. this.$u.route({
  102. url: 'pages/login/upgrade'
  103. })
  104. } else if (this.edition_s == res.data.version) {
  105. console.log("已满足最高版本")
  106. uni.showToast({
  107. icon: 'none',
  108. title: '已经是最新版本了!',
  109. position: "bottom"
  110. })
  111. this.closeModal();
  112. } else {
  113. console.log("全部不满足")
  114. this.$u.route({
  115. url: 'pages/login/upgrade'
  116. })
  117. }
  118. }).catch(err => {
  119. console.log(err)
  120. })
  121. .finally(() => {
  122. // Loading.close()
  123. })
  124. },
  125. getMyinfo() {
  126. request({
  127. url: "/myapp/selectStore",
  128. method: "post",
  129. data: {
  130. storeId: this.$store.state.storeInfo.storeId,
  131. },
  132. })
  133. .then((res) => {
  134. this.userInfo = res.data.data;
  135. console.log(this.userInfo);
  136. })
  137. .catch((err) => {
  138. console.log(err);
  139. })
  140. .finally(() => {
  141. this.loading = false;
  142. uni.hideLoading();
  143. });
  144. },
  145. tishi() {
  146. this.$u.toast('此功能暂不开放');
  147. }
  148. },
  149. };
  150. </script>
  151. <style>
  152. </style>