setting.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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" :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. };
  75. },
  76. created() {
  77. this.getMyinfo();
  78. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  79. //版本号
  80. this.edition_s = wgtinfo.version
  81. })
  82. },
  83. methods: {
  84. ...mapMutations(["logout"]),
  85. exit() {
  86. this.logout();
  87. this.$u.route({
  88. url: "pages/login/index",
  89. type: "reLaunch",
  90. });
  91. },
  92. openPdf(x) {
  93. if (x == 1) {
  94. this.$u.route({
  95. url: "pages/pdf/xy",
  96. });
  97. } else {
  98. this.$u.route({
  99. url: "pages/pdf/zc",
  100. });
  101. }
  102. },
  103. edition() {
  104. uni.getSystemInfo({
  105. success: res => {
  106. },
  107. complete: err => {
  108. if (err.platform == 'android') {
  109. this.onLaunch_s()
  110. } else if (err.platform == 'ios') {
  111. this.iosstartup()
  112. }
  113. }
  114. });
  115. },
  116. iosstartup() {
  117. request({
  118. url: '/baseReq/apkUpgrade',
  119. method: 'get',
  120. params: {
  121. osType: 1
  122. }
  123. }).then(res => {
  124. //最低版本
  125. //更新文案
  126. //最新版本
  127. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  128. //版本号
  129. if (wgtinfo.version == res.data.version) {
  130. this.show_s = true
  131. uni.showToast({
  132. icon: 'none',
  133. title: '已是最新版本',
  134. position: "bottom"
  135. })
  136. } else if (wgtinfo.version != res.data.forceVersion) {
  137. res.data.msg = res.data.msg.replace(/\\n/g, "\n")
  138. uni.showModal({
  139. title: "发现新版本",
  140. content: res.data.msg,
  141. showCancel: false,
  142. confirmText: "立即去AppStore更新",
  143. success: function(res) {
  144. if (res.confirm) {
  145. let appleId = 1518555723
  146. plus.runtime.launchApplication({
  147. action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
  148. }, function(e) {
  149. });
  150. } else if (res.cancel) {
  151. }
  152. }
  153. })
  154. } else if (wgtinfo.version == res.data.forceVersion) {
  155. res.data.msg = res.data.msg.replace(/\\n/g, "\n")
  156. uni.showModal({
  157. title: "发现新版本",
  158. content: res.data.msg,
  159. showCancel: true,
  160. confirmText: "立即去AppStore更新",
  161. success: function(res) {
  162. if (res.confirm) {
  163. let appleId = 1518555723
  164. plus.runtime.launchApplication({
  165. action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
  166. }, function(e) {
  167. });
  168. } else if (res.cancel) {
  169. }
  170. }
  171. })
  172. }
  173. })
  174. }).catch(err => {
  175. })
  176. .finally(() => {
  177. // Loading.close()
  178. })
  179. },
  180. onLaunch_s() {
  181. //升级调用的接口
  182. if (this.show_s == true) {
  183. this.show_s = false
  184. }
  185. request({
  186. url: '/baseReq/apkUpgrade',
  187. method: 'get',
  188. params: {
  189. osType: 0
  190. }
  191. }).then(res => {
  192. //最低版本
  193. //更新文案
  194. //下载最新版地址
  195. //最新版本
  196. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  197. //版本号
  198. if (wgtinfo.version == res.data.version) {
  199. this.show_s = false
  200. uni.showToast({
  201. icon: 'none',
  202. title: '已经是最新版本了',
  203. position: "bottom"
  204. })
  205. this.closeModal();
  206. } else if (wgtinfo.version != res.data.forceVersion) {
  207. this.Copywriting = res.data.msg
  208. this.show_s = true
  209. this.url = res.data.url
  210. this.is_force = true
  211. } else if (wgtinfo.version == res.data.forceVersion) {
  212. this.Copywriting = res.data.msg
  213. this.is_force = false
  214. this.show_s = true
  215. this.url = res.data.url
  216. }
  217. })
  218. }).catch(err => {
  219. })
  220. .finally(() => {
  221. // Loading.close()
  222. })
  223. },
  224. getMyinfo() {
  225. request({
  226. url: "/myapp/selectStore",
  227. method: "post",
  228. data: {
  229. storeId: this.$store.state.storeInfo.storeId,
  230. },
  231. })
  232. .then((res) => {
  233. this.userInfo = res.data.data;
  234. })
  235. .catch((err) => {
  236. })
  237. .finally(() => {
  238. this.loading = false;
  239. uni.hideLoading();
  240. });
  241. },
  242. tishi() {
  243. this.$u.toast('此功能暂不开放');
  244. }
  245. },
  246. };
  247. </script>
  248. <style>
  249. </style>