setting.vue 7.5 KB

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