Browse Source

价格设置

lilei 2 years ago
parent
commit
e6ef7e71d2
4 changed files with 172 additions and 6 deletions
  1. 99 1
      App.vue
  2. 16 0
      api/shelf.js
  3. 4 0
      manifest.json
  4. 53 5
      pages/shelfSetting/shelfSet.vue

+ 99 - 1
App.vue

@@ -1,11 +1,12 @@
 <script>
 <script>
+	var jpushModule = uni.requireNativePlugin("JG-JPush")
 	export default {
 	export default {
 		globalData: {  
 		globalData: {  
 			baseUrl: '',
 			baseUrl: '',
 			token: '',
 			token: '',
 			changeOrg:'',
 			changeOrg:'',
 			version: '', // 当前版本号
 			version: '', // 当前版本号
-			buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
+			buildType: 'dev', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
 			envTips: '', // 环境文字提示
 			envTips: '', // 环境文字提示
 			theme: 'default', // 主题,default
 			theme: 'default', // 主题,default
 			isIphoneXup: false //是否iphonex以及以上的版本
 			isIphoneXup: false //是否iphonex以及以上的版本
@@ -24,6 +25,103 @@
 		},
 		},
 		onLaunch: function() {
 		onLaunch: function() {
 			console.log('App launch')
 			console.log('App launch')
+			// 极光推送
+			if(uni.getSystemInfoSync().platform == "ios"){
+				// 请求定位权限
+				let locationServicesEnabled = jpushModule.locationServicesEnabled()
+				let locationAuthorizationStatus = jpushModule.getLocationAuthorizationStatus()
+				console.log('locationAuthorizationStatus',locationAuthorizationStatus)	
+				if (locationServicesEnabled == true && locationAuthorizationStatus < 3) {
+					jpushModule.requestLocationAuthorization((result)=>{
+						console.log('定位权限',result.status)
+					})
+				}
+				jpushModule.requestNotificationAuthorization((result)=>{
+					let status = result.status
+					if (status < 2) {
+						uni.showToast({
+							icon: 'none',
+							title: '您还没有打开通知权限',
+							duration: 3000
+						})
+					}
+				})
+			}
+			// 初始化
+			jpushModule.initJPushService();
+			jpushModule.setLoggerEnable(true);
+			jpushModule.addConnectEventListener(result=>{
+				let connectEnable = result.connectEnable
+				uni.$emit('connectStatusChange',connectEnable)
+			});
+			
+			jpushModule.addNotificationListener(result=>{
+				let notificationEventType = result.notificationEventType
+				let messageID = result.messageID
+				let title = result.title
+				let content = result.content
+				let extras = result.extras
+				
+				uni.showToast({
+					icon: 'none',
+					title: JSON.stringify(result),
+					duration: 3000
+				})
+			});
+			
+			jpushModule.addCustomMessageListener(result=>{
+				let type = result.type
+				let messageType = result.messageType
+				let content = result.content
+				uni.showToast({
+					icon: 'none',
+					title: JSON.stringify(result),
+					duration: 3000
+				})
+			})
+			
+			jpushModule.addLocalNotificationListener(result=>{
+				let messageID = result.messageID
+				let title = result.title
+				let content = result.content
+				let extras = result.extras
+				uni.showToast({
+					icon: 'none',
+					title: JSON.stringify(result),
+					duration: 3000
+				})
+			})
+			
+			jpushModule.addGeofenceListener(result=>{
+				let code = result.code
+				let type = result.type
+				let geofenceId = result.geofenceId
+				let userInfo = result.userInfo
+				uni.showToast({
+					icon: 'none',
+					title: '触发地理围栏',
+					duration: 3000
+				})
+			})
+			
+			jpushModule.setIsAllowedInMessagePop(true)
+			jpushModule.pullInMessage(result=>{
+				let code = result.code
+				console.log(code)
+			})
+			
+			jpushModule.addInMessageListener(result=>{
+				let eventType = result.eventType
+				let messageType = result.messageType
+				let content = result.content
+				console.log('inMessageListener',eventType,messageType,content)
+				
+				uni.showToast({
+					icon: 'none',
+					title: JSON.stringify(result),
+					duration: 3000
+				})
+			})
 		},
 		},
 		onShow: function() {
 		onShow: function() {
 			console.log('App Show')
 			console.log('App Show')

+ 16 - 0
api/shelf.js

@@ -114,4 +114,20 @@ export const shelfProductSave = (params) => {
     data: params,
     data: params,
     method: 'post'
     method: 'post'
   })
   })
+}
+// 获取价格显示
+export const getShelfPriceShow = (params) => {
+  return axios.request({
+    url: `bizparam/getShelfPriceShow`,
+    data: params,
+    method: 'post'
+  })
+}
+// 更新价格显示
+export const updateShelfPriceShow = (params) => {
+  return axios.request({
+    url: `bizparam/updateShelfPriceShow`,
+    data: params,
+    method: 'post'
+  })
 }
 }

+ 4 - 0
manifest.json

@@ -75,6 +75,7 @@
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
                     "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
+                    "<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
                     "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
                     "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
@@ -109,6 +110,9 @@
                         "apikey" : "uFrhrEO2NhtO72CKuRYB9MNt",
                         "apikey" : "uFrhrEO2NhtO72CKuRYB9MNt",
                         "secretkey" : "GWNVXBvBY21B7h2PvB6pvmXTgN6jdndR"
                         "secretkey" : "GWNVXBvBY21B7h2PvB6pvmXTgN6jdndR"
                     }
                     }
+                },
+                "push" : {
+                    "unipush" : null
                 }
                 }
             },
             },
             "icons" : {
             "icons" : {

+ 53 - 5
pages/shelfSetting/shelfSet.vue

@@ -23,9 +23,17 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="card-row align_center flex justify_between">
 			<view class="card-row align_center flex justify_between">
-				<view class="label" style="width: 50%;" @click="showTip">是否设置完成 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
+				<view class="label" style="width: 50%;" @click="showTip(1)">是否设置完成 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
 				<view class="text" style="width: 50%;text-align: right;"><u-switch v-model="switchVal" @change="switchChange"></u-switch></view>
 				<view class="text" style="width: 50%;text-align: right;"><u-switch v-model="switchVal" @change="switchChange"></u-switch></view>
 			</view>
 			</view>
+			<view class="card-row align_center flex justify_between">
+				<view class="label" style="width: 40%;" @click="showTip(0)">价格显示 <u-icon color="#ffaa00" name="question-circle"></u-icon></view>
+				<view class="text flex align_center" style="width: 60%;text-align: right;" @click="updateShowPrice = true">
+					<text style="width: 80%;flex: 1;">非铺货产品——{{ showPrice == '1' ? '显示': '不显示' }}价格</text>
+					<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
+				</view>
+			</view>
+			<u-action-sheet :list="actionList" @click="clickAction" v-model="updateShowPrice"></u-action-sheet>
 		</view>
 		</view>
 		<!-- 货位信息 -->
 		<!-- 货位信息 -->
 		<view class="shelfPlace" v-if="shelfPlaceList">
 		<view class="shelfPlace" v-if="shelfPlaceList">
@@ -61,7 +69,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-    import { shelfDetail, shelfSave, modifFinishFlag, getProductPlace } from '@/api/shelf'
+    import { shelfDetail, shelfSave, modifFinishFlag, getProductPlace, getShelfPriceShow, updateShelfPriceShow } from '@/api/shelf'
 	import { shelfCartNotEmpty } from '@/api/shelfCart'
 	import { shelfCartNotEmpty } from '@/api/shelfCart'
 	import { createShelfReplenishBill } from '@/api/shelfReplenish'
 	import { createShelfReplenishBill } from '@/api/shelfReplenish'
 	export default {
 	export default {
@@ -81,13 +89,26 @@
 				curTab: '',
 				curTab: '',
 				isLoad: false,
 				isLoad: false,
 				webView: null,
 				webView: null,
-				showDot: false
+				showDot: false,
+				showPrice: '',
+				updateShowPrice: false,
+				actionList:[
+					{
+						text: '非铺货产品——显示价格',
+						fontSize: 32
+					},
+					{
+						text: '非铺货产品——不显示价格',
+						fontSize: 32
+					}
+				]
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
 			this.shelfSn = option.shelfSn
 			this.shelfSn = option.shelfSn
 			// 获取货架详情
 			// 获取货架详情
 			this.getShelfDetal()
 			this.getShelfDetal()
+			this.getShelfPriceShow()
 			// 获取货物
 			// 获取货物
 			this.getShelfPlace()
 			this.getShelfPlace()
 			this.isLoad = true
 			this.isLoad = true
@@ -165,12 +186,12 @@
 					})
 					})
 				}
 				}
 			},
 			},
-			showTip(){
+			showTip(type){
 				uni.showModal({
 				uni.showModal({
 					showCancel:false,
 					showCancel:false,
 					confirmText:"好的",
 					confirmText:"好的",
 					title: "提示",
 					title: "提示",
-					content: "只有当数字货架的“是否设置完成”为“是”,系统才会自动对该货架生成补货单,修理厂才能正常下单。"
+					content: type ? "只有当数字货架的“是否设置完成”为“是”,系统才会自动对该货架生成补货单,修理厂才能正常下单。":"1、非铺货产品,是指不是货架上的产品\n2、终端会员价,对于汽修厂来说,即进货价\n3、如果该产品在销售单里有销售记录,则使用最近一次销售价,如果没有销售记录,则使用箭冠总公司的终端会员价"
 				})
 				})
 			},
 			},
 			// 设置完成是否
 			// 设置完成是否
@@ -278,6 +299,33 @@
 					 }
 					 }
 				})
 				})
 			},
 			},
+			// 获取价格显示设置
+			getShelfPriceShow () {
+			  getShelfPriceShow({ shelfSn: this.shelfSn }).then(res => {
+			    if (res.status == 200) {
+			      this.showPrice = res.data.paramValue
+			    }
+			  })
+			},
+			clickAction(index){
+				uni.showLoading({
+					mask: true,
+					title: '正在保存价格显示...'
+				})
+				updateShelfPriceShow({
+					shelfSn: this.shelfSn,
+					paramValue: index == 0 ? 1 : 0
+				}).then(res => {
+					if(res.status == 200){
+						this.getShelfPriceShow()
+						uni.showToast({
+							icon: 'none',
+							title: res.message
+						})
+					}
+					uni.hideLoading()
+				})
+			},
 			getShelfDetal(){
 			getShelfDetal(){
 				shelfDetail({ sn: this.shelfSn }).then(res => {
 				shelfDetail({ sn: this.shelfSn }).then(res => {
 				  if (res.status == 200) {
 				  if (res.status == 200) {