setting.vue 7.6 KB

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