Przeglądaj źródła

Merge branch 'test' of http://git.echepei.com/sailun/sailun-tbr-web into test

tong 4 lat temu
rodzic
commit
b38dfb541f

+ 1 - 1
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "SAILUN_TBR",
+    "name" : "耀灵全钢店管家",
     "appid" : "__UNI__0C3473D",
     "description" : "测试",
     "versionName" : "0.0.0.0.0.1",

+ 2 - 2
pages/home/Scan-code-in/index.vue

@@ -115,7 +115,7 @@
 			this.getDatalist()
 		},
 		methods: {
-			
+			...mapMutations(["inStore"]),
 			confirm() {
 				this.$u.route({
 					type:'redirectTo',
@@ -134,7 +134,7 @@
 							materialList: this.datalist
 						}
 					}).then(res => {
-						console.log(res)
+						console.log(res.data.code)
 						if(res.data.code == 0){
 							this.dalist = res.data.data
 							for (let i = 0; i < this.dalist.length; i++) {

+ 110 - 9
pages/home/index.vue

@@ -43,7 +43,7 @@
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
 		<u-skeleton :loading="loading" :animation="true"></u-skeleton>
 		<u-toast ref="ulogin" />
-		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force"></luo-version-upgrade>
+		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force" :describe="Copywriting"></luo-version-upgrade>
 	</view>
 </template>
 
@@ -59,7 +59,9 @@
 	require("promise.prototype.finally").shim()
 	import axios from 'axios'
 	export default {
-		components: { versionUpgrade },
+		components: {
+			versionUpgrade
+		},
 		data() {
 			return {
 				bannersList: [],
@@ -70,11 +72,11 @@
 				],
 				show_s: false,
 				url: '',
-				is_force:false,
+				is_force: false,
+				Copywriting: '',
 			}
 		},
 		onLoad() {
-			console.log("@@@")
 			uni.$on('login', (data) => {
 				this.loginStatus = data.msg
 			})
@@ -85,7 +87,6 @@
 					title: "登录成功",
 				})
 			}
-			this.onLaunch_s()
 		},
 		created() {
 			if (this.hasLogin) {
@@ -105,12 +106,107 @@
 						uni.hideLoading();
 					})
 			}
-			this.onLaunch_s()
+		},
+		onShow() {
+			this.system()
 		},
 		computed: {
 			...mapState(['hasLogin'])
 		},
 		methods: {
+			system() {
+				uni.getSystemInfo({
+					success: res => {
+						console.log(res.platform);
+					},
+					complete: err => {
+						if (err.platform == 'android') {
+							this.onLaunch_s()
+						} else if (err.platform == 'ios') {
+							console.log("暂无数据")
+							this.iosstartup()
+						}
+					}
+				});
+			},
+			iosstartup() {
+				request({
+						url: '/baseReq/apkUpgrade',
+						method: 'get',
+						params: {
+							osType: 1
+						}
+					}).then(res => {
+						console.log(res)
+						console.log(res.data.code)
+						console.log(res.data.forceVersion) //最低版本
+						console.log(res.data.msg) //更新文案
+						console.log(res.data.version) //最新版本
+
+						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
+							console.log(wgtinfo);
+							console.log(wgtinfo.version); //版本号
+							if (wgtinfo.version == res.data.version) {
+								this.show_s = true
+								// uni.showToast({
+								// 	icon: 'none',
+								// 	title: '已是最新版本',
+								// 	position: "bottom"
+								// })
+								console.log("已是最新版本")
+							} else if (wgtinfo.version != res.data.forceVersion) {
+								console.log("强制版本更新")
+								uni.showModal({
+									title: "发现新版本",
+									content: res.data.msg,
+									showCancel: false,
+									confirmText: "立即去AppStore更新",
+									success: function(res) {
+										if (res.confirm) {
+											console.log('用户点击确定');
+											let appleId = 1518555723
+											plus.runtime.launchApplication({
+												action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
+											}, function(e) {
+												console.log('Open system default browser failed: ' + e.message);
+											});
+										} else if (res.cancel) {
+											console.log('用户点击取消');
+										}
+									}
+								})
+							} else if (wgtinfo.version == res.data.forceVersion) {
+								console.log("最低版本更新")
+								uni.showModal({
+									title: "发现新版本",
+									content: res.data.msg,
+									showCancel: true,
+									confirmText: "立即去AppStore更新",
+									success: function(res) {
+										if (res.confirm) { 
+											console.log('用户点击确定');
+											let appleId = 1518555723
+											plus.runtime.launchApplication({
+												action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
+											}, function(e) {
+												console.log('Open system default browser failed: ' + e.message);
+											});
+										} else if (res.cancel) {
+											console.log('用户点击取消');
+										}
+									}
+								})
+							}
+
+						})
+
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						// Loading.close()
+					})
+			},
 			//升级调用的接口
 			onLaunch_s() {
 				request({
@@ -129,7 +225,7 @@
 						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
 							console.log(wgtinfo);
 							console.log(wgtinfo.version); //版本号
-							if(wgtinfo.version == res.data.version){
+							if (wgtinfo.version == res.data.version) {
 								this.show_s = false
 								// uni.showToast({
 								// 	icon: 'none',
@@ -137,14 +233,19 @@
 								// 	position: "bottom"
 								// })
 								console.log("已是最新版本")
-							}else if (wgtinfo.version != res.data.forceVersion) {
+							} else if (wgtinfo.version != res.data.forceVersion) {
 								console.log("必须强制更新")
+								this.Copywriting = res.data.msg
+								console.log(this.Copywriting)
 								this.show_s = true
 								console.log(res.data.url)
 								this.url = res.data.url
 								this.is_force = true
-							}else if(wgtinfo.version == res.data.forceVersion){
+							} else if (wgtinfo.version == res.data.forceVersion) {
 								console.log("达到最低版本")
+								this.Copywriting = res.data.msg
+								console.log(this.Copywriting)
+
 								this.is_force = false
 								this.show_s = true
 								this.url = res.data.url

+ 147 - 50
pages/me/setting/setting.vue

@@ -49,7 +49,7 @@
 			</view>
 		</u-card>
 		<u-button type="primary" @click="exit" style="margin: 20rpx">安全退出</u-button>
-		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force"></luo-version-upgrade>
+		<luo-version-upgrade v-if="show_s == true" version="1.0.1" :url="url" :is_force="is_force" :describe="Copywriting"></luo-version-upgrade>
 	</view>
 </template>
 
@@ -68,7 +68,8 @@
 				edition_s: '',
 				show_s: false,
 				url: '',
-				is_force:false,
+				is_force: false,
+				Copywriting: ''
 			};
 		},
 		created() {
@@ -78,7 +79,7 @@
 				console.log(wgtinfo.version); //版本号
 				this.edition_s = wgtinfo.version
 			})
-			
+
 		},
 		methods: {
 			...mapMutations(["logout"]),
@@ -90,59 +91,155 @@
 				});
 			},
 			edition() {
+				uni.getSystemInfo({
+					success: res => {
+						console.log(res.platform);
+					},
+					complete: err => {
+						if (err.platform == 'android') {
+							this.onLaunch_s()
+						} else if (err.platform == 'ios') {
+							console.log("暂无数据")
+							this.iosstartup()
+						}
+					}
+				});
+			},
+			iosstartup(){
+				request({
+						url: '/baseReq/apkUpgrade',
+						method: 'get',
+						params: {
+							osType: 1
+						}
+					}).then(res => {
+						console.log(res)
+						console.log(res.data.code)
+						console.log(res.data.forceVersion) //最低版本
+						console.log(res.data.msg) //更新文案
+						console.log(res.data.version) //最新版本
+				
+						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
+							console.log(wgtinfo);
+							console.log(wgtinfo.version); //版本号
+							if (wgtinfo.version == res.data.version) {
+								this.show_s = true
+								uni.showToast({
+									icon: 'none',
+									title: '已是最新版本',
+									position: "bottom"
+								})
+								console.log("已是最新版本")
+							} else if (wgtinfo.version != res.data.forceVersion) {
+								console.log("强制版本更新")
+								uni.showModal({
+									title: "发现新版本",
+									content: res.data.msg,
+									showCancel: false,
+									confirmText: "立即去AppStore更新",
+									success: function(res) {
+										if (res.confirm) {
+											console.log('用户点击确定');
+											let appleId = 1518555723
+											plus.runtime.launchApplication({
+												action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
+											}, function(e) {
+												console.log('Open system default browser failed: ' + e.message);
+											});
+										} else if (res.cancel) {
+											console.log('用户点击取消');
+										}
+									}
+								})
+							} else if (wgtinfo.version == res.data.forceVersion) {
+								console.log("最低版本更新")
+								uni.showModal({
+									title: "发现新版本",
+									content: res.data.msg,
+									showCancel: true,
+									confirmText: "立即去AppStore更新",
+									success: function(res) {
+										if (res.confirm) { 
+											console.log('用户点击确定');
+											let appleId = 1518555723
+											plus.runtime.launchApplication({
+												action: `itms-apps://itunes.apple.com/cn/app/id${appleId}?mt=8`
+											}, function(e) {
+												console.log('Open system default browser failed: ' + e.message);
+											});
+										} else if (res.cancel) {
+											console.log('用户点击取消');
+										}
+									}
+								})
+							}
+				
+						})
+				
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						// Loading.close()
+					})
+			},
+			onLaunch_s() {
 				//升级调用的接口
-				if(this.show_s == true){
+				if (this.show_s == true) {
 					this.show_s = false
 				}
 				console.log(this.show_s)
-					request({
-							url: '/baseReq/apkUpgrade',
-							method: 'get',
-							params: {
-								osType: 0
+				request({
+						url: '/baseReq/apkUpgrade',
+						method: 'get',
+						params: {
+							osType: 0
+						}
+					}).then(res => {
+						console.log(res)
+						console.log(res.data.forceVersion) //最低版本
+						console.log(res.data.msg) //更新文案
+						console.log(res.data.url) //下载最新版地址
+						console.log(res.data.version) //最新版本
+
+						plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
+							console.log(wgtinfo);
+							console.log(wgtinfo.version); //版本号
+							if (wgtinfo.version == res.data.version) {
+								this.show_s = false
+								uni.showToast({
+									icon: 'none',
+									title: '已经是最新版本了',
+									position: "bottom"
+								})
+								this.closeModal();
+								console.log("已经是最新版本了")
+							} else if (wgtinfo.version != res.data.forceVersion) {
+								console.log("必须强制更新")
+								this.Copywriting = res.data.msg
+								this.show_s = true
+								console.log(res.data.url)
+								this.url = res.data.url
+								this.is_force = true
+							} else if (wgtinfo.version == res.data.forceVersion) {
+								console.log("达到最低版本")
+								this.Copywriting = res.data.msg
+								console.log(this.Copywriting)
+								this.is_force = false
+								this.show_s = true
+								console.log(this.show_s)
+								this.url = res.data.url
 							}
-						}).then(res => {
-							console.log(res)
-							console.log(res.data.forceVersion) //最低版本
-							console.log(res.data.msg) //更新文案
-							console.log(res.data.url) //下载最新版地址
-							console.log(res.data.version) //最新版本
-					
-							plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
-								console.log(wgtinfo);
-								console.log(wgtinfo.version); //版本号
-								if (wgtinfo.version == res.data.version) {
-									this.show_s = false
-									uni.showToast({
-										icon: 'none',
-										title: '已经是最新版本了',
-										position: "bottom"
-									})
-									this.closeModal();
-									console.log("已经是最新版本了")
-								} else if (wgtinfo.version != res.data.forceVersion) {
-									console.log("必须强制更新")
-									this.show_s = true
-									console.log(res.data.url)
-									this.url = res.data.url
-									this.is_force = true
-								} else if (wgtinfo.version == res.data.forceVersion) {
-									console.log("达到最低版本")
-									this.is_force = false
-									this.show_s = true
-									console.log(this.show_s)
-									this.url = res.data.url
-								}
-					
-							})
-					
-						}).catch(err => {
-							console.log(err)
-						})
-						.finally(() => {
-							// Loading.close()
+
 						})
-			
+
+					}).catch(err => {
+						console.log(err)
+					})
+					.finally(() => {
+						// Loading.close()
+					})
+
 			},
 			getMyinfo() {
 				request({

+ 2 - 2
pages/msg/index.vue

@@ -100,9 +100,9 @@ export default {
           console.log(res);
           this.orderList = res.data.category;
 		  console.log(this.orderList.length)
-          for (let i = 0; i < res.data.data.category.length; i++) {
+          for (let i = 0; i < this.orderList.length; i++) {
             // this.orderList = res.data.data.category[i]
-            this.gatTime = res.data.data.category[i].gatTime;
+            this.gatTime = this.orderList[i].gatTime;
           }
         })
         .catch((err) => {