setting.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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" :show-loading="true">
  10. <u-loading slot="loading"></u-loading>
  11. <view slot="error" style="font-size: 24rpx" :fade="true" duration="450">加载失败
  12. </view>
  13. </u-image>
  14. </view>
  15. <view class="u-flex">
  16. <!-- <view class="u-m-r-50" style="color: #0d79ec; font-size: 32rpx">修改门头照</view> -->
  17. <u-icon name="arrow-right" color="#0D79EC" size="28"></u-icon>
  18. </view>
  19. </view>
  20. </view>
  21. </u-card>
  22. <u-card :border="false" padding="20" box-shadow="0px 1px 10px rgba(0,0,0,0.2)" border-radius="20" :show-foot="false"
  23. :show-head="false">
  24. <view slot="body">
  25. <template>
  26. <u-cell-group :border="false">
  27. <u-cell-item title="收货地址管理" @click="tishi">
  28. <u-icon slot="icon" size="42" name="location-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  29. </u-cell-item>
  30. <u-cell-item title="门店名称" :value="userInfo.storeName" :arrow="false">
  31. <u-icon slot="icon" size="42" name="shop-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  32. </u-cell-item>
  33. <u-cell-item title="门店联系人" :value="userInfo.contactName" :arrow="false">
  34. <u-icon slot="icon" size="42" name="contact" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  35. </u-cell-item>
  36. <u-cell-item title="联系电话" :value="userInfo.storePhone" :arrow="false">
  37. <u-icon slot="icon" size="42" name="phone-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  38. </u-cell-item>
  39. <u-cell-item title="用户协议">
  40. <u-icon slot="icon" size="42" name="friends-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  41. </u-cell-item>
  42. <u-cell-item title="隐私政策">
  43. <u-icon slot="icon" size="42" name="info-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  44. </u-cell-item>
  45. <u-cell-item title="版本检测" :value="edition_s" :arrow="false" :border-bottom="false" @click="edition">
  46. <u-icon slot="icon" size="42" name="setting-o" custom-prefix="van-icon" color="#0095FF" style="margin-right: 10rpx"></u-icon>
  47. </u-cell-item>
  48. </u-cell-group>
  49. </template>
  50. </view>
  51. </u-card>
  52. <u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
  53. <luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force" :describe="Copywriting"></luo-version-upgrade>
  54. </view>
  55. </template>
  56. <script>
  57. import {
  58. mapMutations
  59. } from "vuex";
  60. import {
  61. request
  62. } from "../../../common/request/request";
  63. require("promise.prototype.finally").shim();
  64. export default {
  65. data() {
  66. return {
  67. userInfo: {},
  68. edition_s: '',
  69. show_s: false,
  70. url: '',
  71. is_force: false,
  72. Copywriting: ''
  73. };
  74. },
  75. created() {
  76. this.getMyinfo();
  77. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  78. //版本号
  79. this.edition_s = wgtinfo.version
  80. })
  81. },
  82. methods: {
  83. ...mapMutations(["logout"]),
  84. exit() {
  85. this.logout();
  86. this.$u.route({
  87. url: "pages/login/index",
  88. type: "reLaunch",
  89. });
  90. },
  91. edition() {
  92. uni.getSystemInfo({
  93. success: res => {
  94. },
  95. complete: err => {
  96. if (err.platform == 'android') {
  97. this.onLaunch_s()
  98. } else if (err.platform == 'ios') {
  99. this.iosstartup()
  100. }
  101. }
  102. });
  103. },
  104. iosstartup(){
  105. request({
  106. url: '/baseReq/apkUpgrade',
  107. method: 'get',
  108. params: {
  109. osType: 1
  110. }
  111. }).then(res => {
  112. //最低版本
  113. //更新文案
  114. //最新版本
  115. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  116. //版本号
  117. if (wgtinfo.version == res.data.version) {
  118. this.show_s = true
  119. uni.showToast({
  120. icon: 'none',
  121. title: '已是最新版本',
  122. position: "bottom"
  123. })
  124. } else if (wgtinfo.version != res.data.forceVersion) {
  125. res.data.msg = res.data.msg.replace(/\\n/g,"\n")
  126. uni.showModal({
  127. title: "发现新版本",
  128. content: res.data.msg,
  129. showCancel: false,
  130. confirmText: "立即去AppStore更新",
  131. success: function(res) {
  132. if (res.confirm) {
  133. let appleId = 1518555723
  134. plus.runtime.launchApplication({
  135. action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
  136. }, function(e) {
  137. });
  138. } else if (res.cancel) {
  139. }
  140. }
  141. })
  142. } else if (wgtinfo.version == res.data.forceVersion) {
  143. res.data.msg = res.data.msg.replace(/\\n/g,"\n")
  144. uni.showModal({
  145. title: "发现新版本",
  146. content: res.data.msg,
  147. showCancel: true,
  148. confirmText: "立即去AppStore更新",
  149. success: function(res) {
  150. if (res.confirm) {
  151. let appleId = 1518555723
  152. plus.runtime.launchApplication({
  153. action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
  154. }, function(e) {
  155. });
  156. } else if (res.cancel) {
  157. }
  158. }
  159. })
  160. }
  161. })
  162. }).catch(err => {
  163. })
  164. .finally(() => {
  165. // Loading.close()
  166. })
  167. },
  168. onLaunch_s() {
  169. //升级调用的接口
  170. if (this.show_s == true) {
  171. this.show_s = false
  172. }
  173. request({
  174. url: '/baseReq/apkUpgrade',
  175. method: 'get',
  176. params: {
  177. osType: 0
  178. }
  179. }).then(res => {
  180. //最低版本
  181. //更新文案
  182. //下载最新版地址
  183. //最新版本
  184. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  185. //版本号
  186. if (wgtinfo.version == res.data.version) {
  187. this.show_s = false
  188. uni.showToast({
  189. icon: 'none',
  190. title: '已经是最新版本了',
  191. position: "bottom"
  192. })
  193. this.closeModal();
  194. } else if (wgtinfo.version != res.data.forceVersion) {
  195. this.Copywriting = res.data.msg
  196. this.show_s = true
  197. this.url = res.data.url
  198. this.is_force = true
  199. } else if (wgtinfo.version == res.data.forceVersion) {
  200. this.Copywriting = res.data.msg
  201. this.is_force = false
  202. this.show_s = true
  203. this.url = res.data.url
  204. }
  205. })
  206. }).catch(err => {
  207. })
  208. .finally(() => {
  209. // Loading.close()
  210. })
  211. },
  212. getMyinfo() {
  213. request({
  214. url: "/myapp/selectStore",
  215. method: "post",
  216. data: {
  217. storeId: this.$store.state.storeInfo.storeId,
  218. },
  219. })
  220. .then((res) => {
  221. this.userInfo = res.data.data;
  222. })
  223. .catch((err) => {
  224. })
  225. .finally(() => {
  226. this.loading = false;
  227. uni.hideLoading();
  228. });
  229. },
  230. tishi() {
  231. this.$u.toast('此功能暂不开放');
  232. }
  233. },
  234. };
  235. </script>
  236. <style>
  237. </style>