py 2 tahun lalu
induk
melakukan
d5d0296428
5 mengubah file dengan 88 tambahan dan 36 penghapusan
  1. 3 1
      api/common.js
  2. 3 1
      manifest.json
  3. 61 30
      pages-position/Internship-position.vue
  4. 4 2
      pages.json
  5. 17 2
      pages/index/index.vue

+ 3 - 1
api/common.js

@@ -28,4 +28,6 @@ export const getCommonText = (data) => request(commonUrl + 'text', 'post', { ...
 // 获取实习岗位二维码
 export const commonPracticeCode = (data) => request(commonUrl + 'practice_code', 'post', { ...data })
 // 获取外卖配送费
-export const getDeliveryMoney = (data) => request(commonUrl + 'delivery_money', 'post', { ...data },false)
+export const getDeliveryMoney = (data) => request(commonUrl + 'delivery_money', 'post', { ...data },false)
+// 是否是小程序上架审核
+export const commonApplet = (data) => request(commonUrl + 'applet', 'post', { ...data })

+ 3 - 1
manifest.json

@@ -23,7 +23,9 @@
             }
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules" : {
+            "Camera" : {}
+        },
         /* 应用发布信息 */
         "distribute" : {
             /* android打包配置 */

+ 61 - 30
pages-position/Internship-position.vue

@@ -3,7 +3,7 @@
 		<Nav title="实习岗位" leftColor="#fff" bgckgroundBox='transparent' titleColor="#fff"></Nav>
 		<image class="bg" src="@/static/img/index/sxgw.png" mode=""></image>
 		<image class="code-img" :src="codeImg" mode="aspectFit"></image>
-		<image @click="saveImg" class="but-img" src="@/static/img/index/bcdxc.png" mode=""></image>
+		<!-- <image @click="saveImg" class="but-img" src="@/static/img/index/bcdxc.png" mode=""></image> -->
 	</view>
 </template>
 
@@ -34,40 +34,71 @@
 				console.log('触底');
 			},
 			saveImg() {
-				uni.downloadFile({
-					url: this.codeImg,
-					success: downloadResult => {
-						if (downloadResult.statusCode === 200) {
-							// 下载成功,保存图片到系统相册
-							uni.saveImageToPhotosAlbum({
-								filePath: downloadResult.tempFilePath,
-								success: () => {
-									uni.showToast({
-										title: '图片保存成功'
-									});
-								},
-								fail: () => {
-									uni.showToast({
-										title: '图片保存失败',
-										icon: 'none'
-									});
+				let that = this
+				//获取授权列表,查看是否授权写入相册权限
+				uni.getSetting({
+					success(res) {
+						if (!res.authSetting['scope.writePhotosAlbum']) {
+							uni.authorize({
+								scope: 'scope.writePhotosAlbum',
+								success() {
+									that.saveimgtoAlbum(that.codeImg)
 								}
-							});
+							})
 						} else {
-							uni.showToast({
-								title: '图片下载失败',
-								icon: 'none'
-							});
+							that.saveimgtoAlbum(that.codeImg)
 						}
-					},
-					fail: () => {
-						uni.showToast({
-							title: '图片下载失败',
-							icon: 'none'
-						});
 					}
-				});
+				})
 			},
+			saveimgtoAlbum(imgurl) {
+				//图片保存到本地
+				let that = this
+				uni.downloadFile({
+					url: imgurl,
+					success: function(res) {
+						uni.showLoading()
+						uni.saveImageToPhotosAlbum({
+							filePath: res.tempFilePath,
+							success: function(data) {
+								uni.hideLoading()
+								uni.showToast({
+									title: '保存成功',
+									icon: 'success',
+									duration: 1500
+								})
+							},
+							fail: function(err) {
+								uni.hideLoading()
+								if (err.errMsg === "saveImageToPhotosAlbum:fail auth deny") {
+									uni.openSetting({
+										success(settingdata) {
+											if (settingdata.authSetting[
+													'scope.writePhotosAlbum']) {
+												uni.showToast({
+													title: '您已授权成功,请重新保存',
+													icon: 'success',
+													duration: 1500
+												})
+											} else {
+												uni.showToast({
+													title: '尚未授权,无法保存',
+													icon: 'none',
+													duration: 1500
+												})
+											}
+										}
+									})
+								}
+							},
+							complete(res) {
+								console.log(res);
+							}
+						})
+					}
+				})
+
+			}
 		},
 	}
 </script>

+ 4 - 2
pages.json

@@ -92,7 +92,8 @@
 			"pages": [{
 					"path": "ticket",
 					"style": {
-						"navigationBarTitleText": "票务"
+						"navigationBarTitleText": "票务",
+						"disableScroll": true
 					}
 				},
 				{
@@ -219,7 +220,8 @@
 			"pages": [{
 				"path": "Internship-position",
 				"style": {
-					"navigationBarTitleText": "实习岗位"
+					"navigationBarTitleText": "实习岗位",
+					"disableScroll": true
 				}
 			}]
 		},

+ 17 - 2
pages/index/index.vue

@@ -41,8 +41,11 @@
 			<view class="box-border-box plr-24">
 				<view class="nav-list flex-wrap-wrap box-border-box mb-22">
 					<view class="nav-list-item" v-for="(item,i) in navList" :key="i" @click="toUrl(item.type)">
-						<image :src="item.img" mode="scaleToFill"></image>
-						<view class="fs-26 fc-3 text-align-center">{{item.name}}</view>
+						<view class="" v-if="(appletAudit != 1 && item.type != 11) && (appletAudit != 1 && item.type != 10) && (appletAudit != 1 && item.type != 9) && (appletAudit != 1 && item.type != 8)">
+							<image :src="item.img" mode="scaleToFill"></image>
+							<view class="fs-26 fc-3 text-align-center">{{item.name}}</view>
+						</view>
+
 					</view>
 				</view>
 			</view>
@@ -180,6 +183,7 @@
 	import {
 		getNotice,
 		getBanner,
+		commonApplet
 	} from '@/api/common.js';
 	import {
 		getSeckillGoods
@@ -240,14 +244,17 @@
 					{
 						name: "租凭",
 						img: require('@/static/img/index/index-zp.png'),
+						type: 9
 					},
 					{
 						name: "二手市场",
 						img: require('@/static/img/index/index-esss.png'),
+						type: 10
 					},
 					{
 						name: "回收",
 						img: require('@/static/img/index/index-hs.png'),
+						type: 11
 					},
 					{
 						name: "实习岗位",
@@ -278,6 +285,7 @@
 					selectedBorder: '1px rgba(0,0,0,0) solid'
 				},
 				current: 0,
+				appletAudit: ''
 			}
 		},
 
@@ -363,6 +371,13 @@
 			})
 		},
 		methods: {
+			commonApplet() {
+				commonApplet().then((res) => {
+					if (res.code == 1) {
+						this.appletAudit = res.data
+					}
+				})
+			},
 			getHeight() {
 				// 创建选择器对象
 				const query = uni.createSelectorQuery().in(this);