Browse Source

电子相册

xiaohaizhao 1 year ago
parent
commit
353371a869
4 changed files with 317 additions and 72 deletions
  1. 78 72
      manifest.json
  2. 197 0
      packageA/resourceLibrary/picture.vue
  3. 2 0
      pages.json
  4. 40 0
      pages/picture/index.vue

+ 78 - 72
manifest.json

@@ -1,28 +1,28 @@
 {
-    "name" : "营销工具",
-    "appid" : "__UNI__60CDE76",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
+    "name": "营销工具",
+    "appid": "__UNI__60CDE76",
+    "description": "",
+    "versionName": "1.0.0",
+    "versionCode": "100",
+    "transformPx": false,
     /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : true,
-            "waiting" : true,
-            "autoclose" : true,
-            "delay" : 0
+    "app-plus": {
+        "usingComponents": true,
+        "nvueStyleCompiler": "uni-app",
+        "compilerVersion": 3,
+        "splashscreen": {
+            "alwaysShowBeforeRender": true,
+            "waiting": true,
+            "autoclose": true,
+            "delay": 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules": {},
         /* 应用发布信息 */
-        "distribute" : {
+        "distribute": {
             /* android打包配置 */
-            "android" : {
-                "permissions" : [
+            "android": {
+                "permissions": [
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@@ -41,81 +41,87 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios": {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs": {}
         }
     },
     /* 快应用特有相关 */
-    "quickapp" : {},
+    "quickapp": {},
     /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wx08b337e860e3ea58",
-        "setting" : {
-            "urlCheck" : false,
-            "es6" : true,
-            "postcss" : true,
-            "minified" : true
+    "mp-weixin": {
+        "appid": "wx08b337e860e3ea58",
+        "setting": {
+            "urlCheck": false,
+            "es6": true,
+            "postcss": true,
+            "minified": true
         },
-        "usingComponents" : true
+        "usingComponents": true,
+        "permission": {
+            "scope.userLocation": {
+                "desc": "向您推荐附近门店信息,方便自主定位帮您规划导航路线"
+            }
+        },
+        "requiredPrivateInfos": ["getLocation"]
     },
-    "mp-alipay" : {
-        "usingComponents" : true
+    "mp-alipay": {
+        "usingComponents": true
     },
-    "mp-baidu" : {
-        "usingComponents" : true
+    "mp-baidu": {
+        "usingComponents": true
     },
-    "mp-toutiao" : {
-        "usingComponents" : true
+    "mp-toutiao": {
+        "usingComponents": true
     },
-    "uniStatistics" : {
-        "enable" : false
+    "uniStatistics": {
+        "enable": false
     },
-    "vueVersion" : "2",
-    "h5" : {
-        "router" : {
-            "mode" : "hash",
-            "base" : "./"
+    "vueVersion": "2",
+    "h5": {
+        "router": {
+            "mode": "hash",
+            "base": "./"
         },
-        "devServer" : {
-            "https" : false,
-            "disableHostCheck" : true,
-            "proxy" : {
-                "/socket1" : {
-                    "target" : "ws://61.164.207.46:8200",
-                    "changeOrigin" : true,
-                    "pathRewrite" : {
-                        "^/apis1" : ""
+        "devServer": {
+            "https": false,
+            "disableHostCheck": true,
+            "proxy": {
+                "/socket1": {
+                    "target": "ws://61.164.207.46:8200",
+                    "changeOrigin": true,
+                    "pathRewrite": {
+                        "^/apis1": ""
                     }
                 },
-                "/socket" : {
-                    "target" : "wss://www.ibpchina.com.cn",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/apis" : ""
+                "/socket": {
+                    "target": "wss://www.ibpchina.com.cn",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/apis": ""
                     }
                 },
-                "/apis1" : {
-                    "target" : "http://61.164.207.46:8200",
-                    "changeOrigin" : true,
-                    "pathRewrite" : {
-                        "^/apis1" : ""
+                "/apis1": {
+                    "target": "http://61.164.207.46:8200",
+                    "changeOrigin": true,
+                    "pathRewrite": {
+                        "^/apis1": ""
                     }
                 },
-                "/apis" : {
-                    "target" : "https://www.ibpchina.com.cn",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/apis" : ""
+                "/apis": {
+                    "target": "https://www.ibpchina.com.cn",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/apis": ""
                     }
                 }
             }
         },
-        "optimization" : {
-            "treeShaking" : {
-                "enable" : true
+        "optimization": {
+            "treeShaking": {
+                "enable": true
             }
         },
-        "title" : "营销工具"
+        "title": "营销工具"
     }
-}
+}

+ 197 - 0
packageA/resourceLibrary/picture.vue

@@ -0,0 +1,197 @@
+<template>
+    <view>
+        <view class="title">{{ detail.title }}</view>
+        <view class="images">
+            <u--image @click="previewimg(item.attinfos[0].url)" v-for="item in detail.attinfos_pic" :key="item.attachmentid"
+                :src="item.cover" :fade="true" duration="450" :lazy-load="true" mode="widthFix" :width="tovw(355)"
+                :height="'none'">
+                <template v-slot:loading>
+                    <u-loading-icon color="red" />
+                </template>
+            </u--image>
+        </view>
+        <view style="height: 80px;" />
+        <view class="footer">
+            <view v-if="detail.candownload_c" class="sendmail but" hover-class="navigator-hover" @click="showUModal = true">
+                发送邮箱
+            </view>
+            <view class="book but" @click="previewBook" :style="{ width: detail.candownload_c ? '168px' : '100%' }"
+                hover-class="navigator-hover">
+                查看电子书
+            </view>
+        </view>
+        <u-modal :show="showUModal" confirmColor='#C30D23' ref="uModal" showCancelButton :asyncClose="true"
+            @confirm="onSend" @cancel="showUModal = false">
+            <view class="slot-content">
+                <view class="slot-title">
+                    发送邮件
+                </view>
+                <view class="slot-tips">
+                    文件将以邮件的形式发送到指定邮箱
+                </view>
+                <u--input :focus="showUModal" placeholder="请输入邮箱" v-model="eMail" border="bottom" clearable />
+            </view>
+        </u-modal>
+    </view>
+</template>
+
+<script>
+import { viewImage } from "../../utils/settleFiles";
+
+export default {
+    data() {
+        return {
+            sat_sharematerialid: 0,
+            showUModal: false,
+            eMail: "",
+            detail: {}
+        }
+    },
+    onLoad(options) {
+        this.sat_sharematerialid = options.id;
+        this.getDetail();
+    },
+    methods: {
+        getDetail() {
+            this.$Http.basic({
+                "id": 20240407094602,
+                "content": {
+                    "sat_sharematerialid": this.sat_sharematerialid
+                }
+            }).then(res => {
+                console.log("装备资源库详情", res)
+                if (this.cutoff(res.msg)) return;
+                res.data.attinfos_pic = res.data.attinfos_pic.map(v => {
+                    v.cover = this.getSpecifiedImage(v.attinfos[0], "compressed")
+                    return v
+                })
+                this.detail = res.data;
+                uni.setNavigationBarTitle({
+                    title: res.data.title
+                })
+            })
+        },
+        onSend() {
+            let { CheckEmail } = require("../../utils/basicInspection");
+            if (!CheckEmail(this.eMail || '')) return this.$refs.uModal.loading = false;
+            this.$Http.basic({
+                "id": "20240408154702",
+                "content": {
+                    "sat_sharematerialid": this.detail.sat_sharematerialid,
+                    "email": this.eMail
+                }
+            }).then(res => {
+                console.log("发送邮件", res)
+                if (this.cutoff(res.msg, '发送成功')) return this.$refs.uModal.loading = false;
+                this.showUModal = false;
+            })
+        },
+        previewBook() {
+       /*      const innerAudioContext = uni.createInnerAudioContext();
+            innerAudioContext.src = 'https://web-ext-storage.dcloud.net.cn/uni-app/ForElise.mp3';
+            innerAudioContext.autoplay = true;
+            innerAudioContext.loop = true;
+            innerAudioContext.play();
+            this.$Http.innerAudioContext = innerAudioContext; */
+
+            let parems = encodeURIComponent(JSON.stringify({
+                "accesstoken": uni.getStorageSync('userMsg').token,
+                "id": "20240407140002",
+                "content": {
+                    "ownertable": "sat_sharematerial",
+                    "ownerid": this.sat_sharematerialid,
+                    "pageSize": "9999",
+                }
+            }))
+            uni.navigateTo({
+                url: `/pages/picture/index?parems=${parems}&title=${this.detail.title}`,
+            })
+        },
+        previewimg(url) {
+            viewImage(url)
+        }
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+.title {
+    width: 100vw;
+    padding: 10px;
+    font-family: PingFang SC, PingFang SC;
+    font-weight: 500;
+    font-size: 14px;
+    color: #333333;
+    line-height: 20px;
+    background: #fff;
+    font-weight: bold;
+    box-sizing: border-box;
+}
+
+.slot-content {
+    width: 100%;
+    text-align: center;
+
+    .slot-title {
+        height: 26px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-weight: bold;
+        font-size: 18px;
+        color: #000000;
+    }
+
+    .slot-tips {
+        line-height: 20px;
+        font-family: Source Han Sans SC, Source Han Sans SC;
+        font-size: 14px;
+        color: #666666;
+        margin-bottom: 30px;
+        margin-top: 10px;
+    }
+}
+
+.images {
+    display: flex;
+    width: 100vw;
+    flex-direction: column;
+    align-items: center;
+}
+
+.footer {
+    position: fixed;
+    display: flex;
+    justify-content: space-between;
+    bottom: 0;
+    width: 100vw;
+    height: 65px;
+    background: #FFFFFF;
+    box-shadow: 0px -2px 6px 1px rgba(0, 0, 0, 0.16);
+    border-radius: 0px 0px 0px 0px;
+    padding: 5px 14px;
+    box-sizing: border-box;
+
+    .but {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        width: 168px;
+        height: 45px;
+        border-radius: 5px;
+        box-sizing: border-box;
+        font-family: PingFang SC, PingFang SC;
+        font-size: 16px;
+    }
+
+    .sendmail {
+        background: #FFFFFF;
+        border: 1px solid #999999;
+        color: #666666;
+    }
+
+    .book {
+        background: #C30D23;
+        color: #FFFFFF;
+    }
+
+}
+</style>

+ 2 - 0
pages.json

@@ -39,6 +39,8 @@
 			"path": "resourceLibrary/index"
 		}, {
 			"path": "resourceLibrary/detail"
+		}, {
+			"path": "resourceLibrary/picture"
 		}, {
 			"path": "webView/webView"
 		}, {

+ 40 - 0
pages/picture/index.vue

@@ -0,0 +1,40 @@
+<template>
+	<view>
+		<web-view v-if="webSrc" :src="webSrc" @message="onPostMessage" />
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			webSrc: ""
+		}
+	},
+	onLoad(options) {
+		/* encodeURIComponent(``) */
+		if (options.parems) this.webSrc = `http://61.164.207.46:8200/webviewtools/index.html#/pages/photoGallery/index?parems=${options.parems}&title=${options.title || '电子相册'}`;
+		if (options.title) uni.setNavigationBarTitle({
+			title: options.title
+		})
+	},
+	onUnload() {
+		this.$Http.innerAudioContext && this.$Http.innerAudioContext.destroy()
+	},
+	methods: {
+		onPostMessage(e) {
+			console.log("onPostMessage", e)
+		}
+	},
+}
+</script>
+
+<style lang="scss" scoped>
+.coverView {
+	position: fixed;
+	bottom: 10px;
+	left: 10px;
+	color: #fff;
+	z-index: 999999999;
+}
+</style>