Merge branch 'master' into v3.3
This commit is contained in:
33
README.md
33
README.md
@ -2,30 +2,32 @@
|
|||||||
|
|
||||||
## Hbuilderx
|
## Hbuilderx
|
||||||
|
|
||||||
- 已支持HBuilderX最新版
|
- 已支持 HBuilderX 最新版
|
||||||
|
|
||||||
## 小程序安装步骤
|
## 小程序安装步骤
|
||||||
- 先从私服上clone下来项目
|
|
||||||
- 下载uni的开发者工具 https://www.dcloud.io/hbuilderx.html
|
- 先从私服上 clone 下来项目
|
||||||
- 登录微信开发者工具打开 菜单 > 设置 > 安全设置 勾选服务端口为开启
|
- 下载 uni 的开发者工具 https://www.dcloud.io/hbuilderx.html
|
||||||
- 当前项目下执行 npm install
|
- 登录微信开发者工具打开 菜单 > 设置 > 安全设置 勾选服务端口为开启
|
||||||
|
- 当前项目下执行 npm install !!!!!!!!!必须执行,找不到模块都是因为这个原因导致的
|
||||||
- 命令行进入项目所在的目录,点击 hbuilderx > 菜单 > 运行 > 运行到小程序模拟器 > 微信开发者工具
|
- 命令行进入项目所在的目录,点击 hbuilderx > 菜单 > 运行 > 运行到小程序模拟器 > 微信开发者工具
|
||||||
- uni会自动打开微信开发者工具并且打开uni的项目
|
- uni 会自动打开微信开发者工具并且打开 uni 的项目
|
||||||
|
|
||||||
## 注意事项
|
## 注意事项
|
||||||
- uniapp v3.1版本已经兼容h5,另外yshop有自己的H5,uniappv3.1以下版本未对H5端进行处理,如果需要请自行兼容。
|
|
||||||
- manifest.json 中可以配置uni项目的一些信息
|
|
||||||
- 打开manifest.json可配置小程序的 appid
|
|
||||||
- 由于需要兼容app,公共样式由 main.js 迁移到了 App.vue,公共样式请在App.vue中进行编辑
|
|
||||||
- 由于需要兼容app,尺寸单位由之前的rem改为rpx,由于修改样式工作量太大并且容易出错,已将.css更改为.less并在其中以之前rem的单位*100,获得新的rpx单位
|
|
||||||
- 如需修改样式问题,请编辑.less的文件,请勿编辑.css的文件
|
|
||||||
|
|
||||||
|
- uniapp v3.1 版本已经兼容 h5,另外 yshop 有自己的 H5,uniappv3.1 以下版本未对 H5 端进行处理,如果需要请自行兼容。
|
||||||
|
- manifest.json 中可以配置 uni 项目的一些信息
|
||||||
|
- 打开 manifest.json 可配置小程序的 appid
|
||||||
|
- 由于需要兼容 app,公共样式由 main.js 迁移到了 App.vue,公共样式请在 App.vue 中进行编辑
|
||||||
|
- 由于需要兼容 app,尺寸单位由之前的 rem 改为 rpx,由于修改样式工作量太大并且容易出错,已将.css 更改为.less 并在其中以之前 rem 的单位\*100,获得新的 rpx 单位
|
||||||
|
- 如需修改样式问题,请编辑.less 的文件,请勿编辑.css 的文件
|
||||||
|
|
||||||
## git issuse 地址
|
## git issuse 地址
|
||||||
|
|
||||||
https://gitee.com/guchengwuyue/yshopmall
|
https://gitee.com/guchengwuyue/yshopmall
|
||||||
|
|
||||||
### 请按照以下模板提交 issuse
|
### 请按照以下模板提交 issuse
|
||||||
|
|
||||||
标题:
|
标题:
|
||||||
H5/uni/后端代码/后台管理系统+简单描述
|
H5/uni/后端代码/后台管理系统+简单描述
|
||||||
|
|
||||||
@ -39,10 +41,9 @@ v3.0
|
|||||||
windows/macOS/Linux
|
windows/macOS/Linux
|
||||||
|
|
||||||
问题描述:
|
问题描述:
|
||||||
Ps:如果是uni出现问题,请具体描述是运行那个端小程序/android/ios
|
Ps:如果是 uni 出现问题,请具体描述是运行那个端小程序/android/ios
|
||||||
|
|
||||||
## 声明
|
## 声明
|
||||||
- app测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。
|
|
||||||
- 运行app项目ios需要安装xcode,安卓需要装安卓的sdk以及安卓模拟器,建议安卓安装genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费
|
|
||||||
|
|
||||||
|
|
||||||
|
- app 测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。
|
||||||
|
- 运行 app 项目 ios 需要安装 xcode,安卓需要装安卓的 sdk 以及安卓模拟器,建议安卓安装 genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费
|
||||||
|
|||||||
7
main.js
7
main.js
@ -14,7 +14,7 @@ Vue.component('cu-custom', cuCustom)
|
|||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.config.devtools = process.env.NODE_ENV !== 'production'
|
Vue.config.devtools = process.env.NODE_ENV !== 'production'
|
||||||
|
|
||||||
Vue.prototype.$validator = function(rule) {
|
Vue.prototype.$validator = function (rule) {
|
||||||
return new schema(rule)
|
return new schema(rule)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,11 +67,10 @@ deviceType = 'routine'
|
|||||||
import { wechat, clearAuthStatus, oAuth, auth, toAuth, pay, openAddress, openShareAll, openShareAppMessage, openShareTimeline, wechatEvevt, ready, wxShowLocation } from '@/libs/wechat'
|
import { wechat, clearAuthStatus, oAuth, auth, toAuth, pay, openAddress, openShareAll, openShareAppMessage, openShareTimeline, wechatEvevt, ready, wxShowLocation } from '@/libs/wechat'
|
||||||
|
|
||||||
import { isWeixin } from '@/utils'
|
import { isWeixin } from '@/utils'
|
||||||
const CACHE_KEY = 'clear_0.0.1'
|
|
||||||
|
|
||||||
if (!cookie.has(CACHE_KEY)) {
|
if (!cookie.has(cookie.CACHE_KEY)) {
|
||||||
cookie.clearAll()
|
cookie.clearAll()
|
||||||
cookie.set(CACHE_KEY, 1)
|
cookie.set(cookie.CACHE_KEY, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var urlSpread = parseQuery()['spread']
|
var urlSpread = parseQuery()['spread']
|
||||||
|
|||||||
590
manifest.json
590
manifest.json
@ -1,296 +1,296 @@
|
|||||||
{
|
{
|
||||||
"name": "yshopmall",
|
"name" : "yshopmall",
|
||||||
"appid": "__UNI__C7A519E",
|
"appid" : "__UNI__C7A519E",
|
||||||
"description": "",
|
"description" : "",
|
||||||
"versionName": "1.0.1",
|
"versionName" : "1.0.2",
|
||||||
"versionCode": 1,
|
"versionCode" : 2,
|
||||||
"transformPx": false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus": {
|
"app-plus" : {
|
||||||
"usingComponents": true,
|
"usingComponents" : true,
|
||||||
"nvueCompiler": "uni-app",
|
"nvueCompiler" : "uni-app",
|
||||||
"compilerVersion": 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen": {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender": true,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting": false,
|
"waiting" : false,
|
||||||
"autoclose": true,
|
"autoclose" : true,
|
||||||
"delay": 0
|
"delay" : 0
|
||||||
},
|
},
|
||||||
/* 模块配置 */
|
/* 模块配置 */
|
||||||
"modules": {
|
"modules" : {
|
||||||
"OAuth": {},
|
"OAuth" : {},
|
||||||
"Payment": {},
|
"Payment" : {},
|
||||||
"Share": {},
|
"Share" : {},
|
||||||
"Geolocation": {}
|
"Geolocation" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute": {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android": {
|
"android" : {
|
||||||
"permissions": [
|
"permissions" : [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<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_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||||
"<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.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios": {},
|
"ios" : {},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs": {
|
"sdkConfigs" : {
|
||||||
"oauth": {
|
"oauth" : {
|
||||||
"weixin": {
|
"weixin" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
"appid" : "wx7c84ede33062d1e4",
|
||||||
"appsecret": "c47ef66d3311194da44e60387d5c1abd",
|
"appsecret" : "c47ef66d3311194da44e60387d5c1abd",
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks" : "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment": {
|
"payment" : {
|
||||||
"weixin": {
|
"weixin" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
"appid" : "wx7c84ede33062d1e4",
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks" : "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute": {
|
"distribute" : {
|
||||||
/* android打包配置 */
|
/* android打包配置 */
|
||||||
"android": {
|
"android" : {
|
||||||
"permissions": [
|
"permissions" : [
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<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.RECORD_AUDIO\"/>",
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios": {},
|
"ios" : {},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs": {
|
"sdkConfigs" : {
|
||||||
"oauth": {
|
"oauth" : {
|
||||||
"weixin": {
|
"weixin" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
"appid" : "wx7c84ede33062d1e4",
|
||||||
"appsecret": "c47ef66d3311194da44e60387d5c1abd",
|
"appsecret" : "c47ef66d3311194da44e60387d5c1abd",
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks" : "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment": {
|
"payment" : {
|
||||||
"weixin": {
|
"weixin" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
"appid" : "wx7c84ede33062d1e4",
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks" : "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share": {
|
"share" : {
|
||||||
"weixin": {
|
"weixin" : {
|
||||||
"appid": "wx7c84ede33062d1e4",
|
"appid" : "wx7c84ede33062d1e4",
|
||||||
"UniversalLinks": "https://yixiang.co/app/"
|
"UniversalLinks" : "https://yixiang.co/app/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ad": {},
|
"ad" : {},
|
||||||
"geolocation": {}
|
"geolocation" : {}
|
||||||
},
|
},
|
||||||
"splashscreen": {
|
"splashscreen" : {
|
||||||
"ios": {
|
"ios" : {
|
||||||
"iphone": {
|
"iphone" : {
|
||||||
"portrait-896h@3x": "splash/1242+2688.png",
|
"portrait-896h@3x" : "splash/1242+2688.png",
|
||||||
"portrait-896h@2x": "splash/828+1792.png",
|
"portrait-896h@2x" : "splash/828+1792.png",
|
||||||
"iphonex": "splash/1125+2436.png",
|
"iphonex" : "splash/1125+2436.png",
|
||||||
"retina55": "splash/1142+2208.png",
|
"retina55" : "splash/1142+2208.png",
|
||||||
"retina47": "splash/750+1334.png",
|
"retina47" : "splash/750+1334.png",
|
||||||
"retina40": "splash/640+1136.png",
|
"retina40" : "splash/640+1136.png",
|
||||||
"retina35": "splash/640+960.png"
|
"retina35" : "splash/640+960.png"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"android": {
|
"android" : {
|
||||||
"hdpi": "splash/480+762.png",
|
"hdpi" : "splash/480+762.png",
|
||||||
"xhdpi": "splash/720+1242.png",
|
"xhdpi" : "splash/720+1242.png",
|
||||||
"xxhdpi": "splash/1080+1882.png"
|
"xxhdpi" : "splash/1080+1882.png"
|
||||||
},
|
},
|
||||||
"iosStyle": "common"
|
"iosStyle" : "common"
|
||||||
},
|
},
|
||||||
"icons": {
|
"icons" : {
|
||||||
"android": {
|
"android" : {
|
||||||
"hdpi": "icons/72x72.png",
|
"hdpi" : "icons/72x72.png",
|
||||||
"xhdpi": "icons/96x96.png",
|
"xhdpi" : "icons/96x96.png",
|
||||||
"xxhdpi": "icons/144x144.png",
|
"xxhdpi" : "icons/144x144.png",
|
||||||
"xxxhdpi": "icons/192x192.png"
|
"xxxhdpi" : "icons/192x192.png"
|
||||||
},
|
},
|
||||||
"ios": {
|
"ios" : {
|
||||||
"appstore": "icons/1024x1024.png",
|
"appstore" : "icons/1024x1024.png",
|
||||||
"ipad": {
|
"ipad" : {
|
||||||
"app": "icons/76x76.png",
|
"app" : "icons/76x76.png",
|
||||||
"app@2x": "icons/152x152.png",
|
"app@2x" : "icons/152x152.png",
|
||||||
"notification": "icons/20x20.png",
|
"notification" : "icons/20x20.png",
|
||||||
"notification@2x": "icons/40x40.png",
|
"notification@2x" : "icons/40x40.png",
|
||||||
"proapp@2x": "icons/167x167.png",
|
"proapp@2x" : "icons/167x167.png",
|
||||||
"settings": "icons/29x29.png",
|
"settings" : "icons/29x29.png",
|
||||||
"settings@2x": "icons/58x58.png",
|
"settings@2x" : "icons/58x58.png",
|
||||||
"spotlight": "icons/40x40.png",
|
"spotlight" : "icons/40x40.png",
|
||||||
"spotlight@2x": "icons/80x80.png"
|
"spotlight@2x" : "icons/80x80.png"
|
||||||
},
|
},
|
||||||
"iphone": {
|
"iphone" : {
|
||||||
"app@2x": "icons/120x120.png",
|
"app@2x" : "icons/120x120.png",
|
||||||
"app@3x": "icons/180x180.png",
|
"app@3x" : "icons/180x180.png",
|
||||||
"notification@2x": "icons/40x40.png",
|
"notification@2x" : "icons/40x40.png",
|
||||||
"notification@3x": "icons/60x60.png",
|
"notification@3x" : "icons/60x60.png",
|
||||||
"settings@2x": "icons/58x58.png",
|
"settings@2x" : "icons/58x58.png",
|
||||||
"settings@3x": "icons/87x87.png",
|
"settings@3x" : "icons/87x87.png",
|
||||||
"spotlight@2x": "icons/80x80.png",
|
"spotlight@2x" : "icons/80x80.png",
|
||||||
"spotlight@3x": "icons/120x120.png"
|
"spotlight@3x" : "icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
"ad" : {}
|
||||||
"quickapp": {},
|
},
|
||||||
"mp-weixin": {
|
"quickapp" : {},
|
||||||
"appid": "wx604d2ea4702620d2",
|
"mp-weixin" : {
|
||||||
"setting": {
|
"appid" : "wx604d2ea4702620d2",
|
||||||
"urlCheck": true,
|
"setting" : {
|
||||||
"postcss": true,
|
"urlCheck" : true,
|
||||||
"minified": true
|
"postcss" : true,
|
||||||
},
|
"minified" : true
|
||||||
"ad": {},
|
},
|
||||||
"geolocation": {}
|
"ad" : {},
|
||||||
},
|
"geolocation" : {}
|
||||||
"splashscreen": {
|
},
|
||||||
"ios": {
|
"splashscreen" : {
|
||||||
"iphone": {
|
"ios" : {
|
||||||
"portrait-896h@3x": "splash/1242+2688.png",
|
"iphone" : {
|
||||||
"portrait-896h@2x": "splash/828+1792.png",
|
"portrait-896h@3x" : "splash/1242+2688.png",
|
||||||
"iphonex": "splash/1125+2436.png",
|
"portrait-896h@2x" : "splash/828+1792.png",
|
||||||
"retina55": "splash/1142+2208.png",
|
"iphonex" : "splash/1125+2436.png",
|
||||||
"retina47": "splash/750+1334.png",
|
"retina55" : "splash/1142+2208.png",
|
||||||
"retina40": "splash/640+1136.png",
|
"retina47" : "splash/750+1334.png",
|
||||||
"retina35": "splash/640+960.png"
|
"retina40" : "splash/640+1136.png",
|
||||||
}
|
"retina35" : "splash/640+960.png"
|
||||||
},
|
}
|
||||||
"android": {
|
},
|
||||||
"hdpi": "splash/480+762.png",
|
"android" : {
|
||||||
"xhdpi": "splash/720+1242.png",
|
"hdpi" : "splash/480+762.png",
|
||||||
"xxhdpi": "splash/1080+1882.png"
|
"xhdpi" : "splash/720+1242.png",
|
||||||
},
|
"xxhdpi" : "splash/1080+1882.png"
|
||||||
"iosStyle": "common"
|
},
|
||||||
},
|
"iosStyle" : "common"
|
||||||
"icons": {
|
},
|
||||||
"android": {
|
"icons" : {
|
||||||
"hdpi": "icons/72x72.png",
|
"android" : {
|
||||||
"xhdpi": "icons/96x96.png",
|
"hdpi" : "icons/72x72.png",
|
||||||
"xxhdpi": "icons/144x144.png",
|
"xhdpi" : "icons/96x96.png",
|
||||||
"xxxhdpi": "icons/192x192.png"
|
"xxhdpi" : "icons/144x144.png",
|
||||||
},
|
"xxxhdpi" : "icons/192x192.png"
|
||||||
"ios": {
|
},
|
||||||
"appstore": "icons/1024x1024.png",
|
"ios" : {
|
||||||
"ipad": {
|
"appstore" : "icons/1024x1024.png",
|
||||||
"app": "icons/76x76.png",
|
"ipad" : {
|
||||||
"app@2x": "icons/152x152.png",
|
"app" : "icons/76x76.png",
|
||||||
"notification": "icons/20x20.png",
|
"app@2x" : "icons/152x152.png",
|
||||||
"notification@2x": "icons/40x40.png",
|
"notification" : "icons/20x20.png",
|
||||||
"proapp@2x": "icons/167x167.png",
|
"notification@2x" : "icons/40x40.png",
|
||||||
"settings": "icons/29x29.png",
|
"proapp@2x" : "icons/167x167.png",
|
||||||
"settings@2x": "icons/58x58.png",
|
"settings" : "icons/29x29.png",
|
||||||
"spotlight": "icons/40x40.png",
|
"settings@2x" : "icons/58x58.png",
|
||||||
"spotlight@2x": "icons/80x80.png"
|
"spotlight" : "icons/40x40.png",
|
||||||
},
|
"spotlight@2x" : "icons/80x80.png"
|
||||||
"iphone": {
|
},
|
||||||
"app@2x": "icons/120x120.png",
|
"iphone" : {
|
||||||
"app@3x": "icons/180x180.png",
|
"app@2x" : "icons/120x120.png",
|
||||||
"notification@2x": "icons/40x40.png",
|
"app@3x" : "icons/180x180.png",
|
||||||
"notification@3x": "icons/60x60.png",
|
"notification@2x" : "icons/40x40.png",
|
||||||
"settings@2x": "icons/58x58.png",
|
"notification@3x" : "icons/60x60.png",
|
||||||
"settings@3x": "icons/87x87.png",
|
"settings@2x" : "icons/58x58.png",
|
||||||
"spotlight@2x": "icons/80x80.png",
|
"settings@3x" : "icons/87x87.png",
|
||||||
"spotlight@3x": "icons/120x120.png"
|
"spotlight@2x" : "icons/80x80.png",
|
||||||
}
|
"spotlight@3x" : "icons/120x120.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"quickapp": {},
|
},
|
||||||
"mp-weixin": {
|
"quickapp" : {},
|
||||||
"appid": "wx604d2ea4702620d2",
|
"mp-weixin" : {
|
||||||
"setting": {
|
"appid" : "wx604d2ea4702620d2",
|
||||||
"urlCheck": false
|
"setting" : {
|
||||||
},
|
"urlCheck" : false
|
||||||
"usingComponents": true,
|
},
|
||||||
"permission": {
|
"usingComponents" : true,
|
||||||
"scope.userLocation": {
|
"permission" : {
|
||||||
"desc": "你的位置信息将用于小程序位置接口的效果展示"
|
"scope.userLocation" : {
|
||||||
}
|
"desc" : "你的位置信息将用于小程序位置接口的效果展示"
|
||||||
},
|
}
|
||||||
"plugins": {
|
},
|
||||||
// #ifdef MP-WEIXIN
|
"plugins" : {
|
||||||
"live-player-plugin": {
|
// #ifdef MP-WEIXIN
|
||||||
"version": "1.2.8",
|
"live-player-plugin" : {
|
||||||
"provider": "wx2b03c6e691cd7370"
|
"version" : "1.2.8",
|
||||||
}
|
"provider" : "wx2b03c6e691cd7370"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
// #endif
|
},
|
||||||
"mp-alipay": {
|
// #endif
|
||||||
"usingComponents": true
|
"mp-alipay" : {
|
||||||
},
|
"usingComponents" : true
|
||||||
"mp-baidu": {
|
},
|
||||||
"usingComponents": true
|
"mp-baidu" : {
|
||||||
},
|
"usingComponents" : true
|
||||||
"mp-toutiao": {
|
},
|
||||||
"usingComponents": true
|
"mp-toutiao" : {
|
||||||
},
|
"usingComponents" : true
|
||||||
"h5": {
|
},
|
||||||
"title": "yshop",
|
"h5" : {
|
||||||
"devServer": {
|
"title" : "yshop",
|
||||||
"disableHostCheck": true,
|
"devServer" : {
|
||||||
"proxy": {
|
"disableHostCheck" : true,
|
||||||
"^/api": {
|
"proxy" : {
|
||||||
"target": "https://wxapi.yixiang.co",
|
"^/api" : {
|
||||||
"changeOrigin": true,
|
"target" : "https://wxapi.yixiang.co",
|
||||||
"secure": true,
|
"changeOrigin" : true,
|
||||||
"pathRewrite": {
|
"secure" : true,
|
||||||
"^/api": "/api"
|
"pathRewrite" : {
|
||||||
}
|
"^/api" : "/api"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"router": {
|
},
|
||||||
"mode": "history"
|
"router" : {
|
||||||
},
|
"mode" : "history"
|
||||||
|
},
|
||||||
"sdkConfigs": {
|
"sdkConfigs" : {
|
||||||
"maps": {
|
"maps" : {
|
||||||
"qqmap": {
|
"qqmap" : {
|
||||||
"key": ""
|
"key" : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"domain": "h5.yixiang.co"
|
"domain" : "h5.yixiang.co"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
"animate.css": "^3.7.2",
|
"animate.css": "^3.7.2",
|
||||||
"async-validator": "^3.2.4",
|
"async-validator": "^3.2.4",
|
||||||
"dayjs": "^1.8.22",
|
"dayjs": "^1.8.22",
|
||||||
|
"flyio": "^0.6.14",
|
||||||
"jweixin-module": "^1.6.0",
|
"jweixin-module": "^1.6.0",
|
||||||
"miniapp-color-thief": "^1.0.5",
|
"miniapp-color-thief": "^1.0.5",
|
||||||
"vconsole": "^3.3.4",
|
"vconsole": "^3.3.4",
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default {
|
|||||||
// swiperSlide
|
// swiperSlide
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data: function() {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
swiperPosters: {
|
swiperPosters: {
|
||||||
speed: 1000,
|
speed: 1000,
|
||||||
@ -44,7 +44,7 @@ export default {
|
|||||||
activeIndex: 0,
|
activeIndex: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function () {
|
||||||
this.getIndex()
|
this.getIndex()
|
||||||
let that = this
|
let that = this
|
||||||
// this.swiper.on("slideChange", function() {
|
// this.swiper.on("slideChange", function() {
|
||||||
@ -57,7 +57,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getIndex: function() {
|
getIndex: function () {
|
||||||
let that = this
|
let that = this
|
||||||
getSpreadImg({
|
getSpreadImg({
|
||||||
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType,
|
from: this.$deviceType == 'weixin' || this.$deviceType == 'weixinh5' ? 'uniappH5' : this.$deviceType,
|
||||||
@ -79,64 +79,33 @@ export default {
|
|||||||
this.isDown = true
|
this.isDown = true
|
||||||
var downloadUrl = imgsrc
|
var downloadUrl = imgsrc
|
||||||
|
|
||||||
// if (!wx.saveImageToPhotosAlbum) {
|
|
||||||
// uni.showModal({
|
|
||||||
// title: '提示',
|
|
||||||
// content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。',
|
|
||||||
// })
|
|
||||||
// that.openDialogVisible = true
|
|
||||||
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
that.downloadFile(downloadUrl)
|
that.downloadFile(downloadUrl)
|
||||||
|
|
||||||
// 可以通过 uni.getSetting 先查询一下用户是否授权了 "scope.writePhotosAlbum" 这个 scope
|
|
||||||
// uni.getSetting({
|
|
||||||
// success(res) {
|
|
||||||
// if (!res.authSetting["scope.writePhotosAlbum"]) {
|
|
||||||
// that.openDialogVisible = true;
|
|
||||||
|
|
||||||
// // 接口调用询问
|
|
||||||
// uni.authorize({
|
|
||||||
// scope: "scope.writePhotosAlbum",
|
|
||||||
// success() {
|
|
||||||
// that.downloadFile(downloadUrl);
|
|
||||||
// },
|
|
||||||
// fail() {
|
|
||||||
// // 用户拒绝了授权
|
|
||||||
// // 打开设置页面
|
|
||||||
// uni.openSetting({
|
|
||||||
// success: function (data) {},
|
|
||||||
// fail: function (data) {}
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// that.downloadFile(downloadUrl);
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// fail(res) {
|
|
||||||
// that.openDialogVisible = true;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
saveImg: function() {
|
saveImg: function () {
|
||||||
this.downloadIamge(this.info[this.activeIndex].wap_poster, 'poster' + this.activeIndex)
|
this.downloadIamge(this.info[this.activeIndex].wap_poster, 'poster' + this.activeIndex)
|
||||||
},
|
},
|
||||||
downloadFile(url) {
|
downloadFile(url) {
|
||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url,
|
url,
|
||||||
fail: function(res) {
|
fail: function (res) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '保存失败',
|
content: '保存失败',
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
success: function(res) {
|
success: function (res) {
|
||||||
uni.showModal({
|
uni.saveImageToPhotosAlbum({
|
||||||
title: '提示',
|
filePath: res.tempFilePath,
|
||||||
content: '保存成功',
|
success: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存成功!',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '保存失败',
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,12 +1,10 @@
|
|||||||
import { trim, isType } from "@/utils";
|
import { trim, isType } from '@/utils'
|
||||||
|
|
||||||
const doc = null;
|
const doc = null
|
||||||
|
const CACHE_KEY = 'clear_0.0.1'
|
||||||
// const doc = window.document;
|
// const doc = window.document;
|
||||||
|
|
||||||
function get(key) {
|
function get(key) {
|
||||||
if (!key || !_has(key)) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
return uni.getStorageSync(key)
|
return uni.getStorageSync(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,29 +14,26 @@ function all() {
|
|||||||
|
|
||||||
function set(key, data, time) {
|
function set(key, data, time) {
|
||||||
if (!key) {
|
if (!key) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
uni.setStorageSync(key, data)
|
uni.setStorageSync(key, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(key) {
|
function remove(key) {
|
||||||
if (!key || !_has(key)) {
|
if (!key || !_has(key)) {
|
||||||
return;
|
return
|
||||||
}
|
}
|
||||||
uni.removeStorageSync(key)
|
uni.removeStorageSync(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearAll() {
|
function clearAll() {
|
||||||
const res = uni.getStorageInfoSync();
|
const res = uni.getStorageInfoSync()
|
||||||
res.keys.map((item) => {
|
res.keys.map(item => {
|
||||||
if (item == 'redirect' || item == 'spread') {
|
if (item == 'redirect' || item == 'spread' || item == CACHE_KEY) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
remove(item)
|
remove(item)
|
||||||
})
|
})
|
||||||
console.log(res)
|
|
||||||
// debugger
|
|
||||||
// uni.clearStorageSync()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _has(key) {
|
function _has(key) {
|
||||||
@ -58,5 +53,6 @@ export default {
|
|||||||
set,
|
set,
|
||||||
remove,
|
remove,
|
||||||
clearAll,
|
clearAll,
|
||||||
has: _has
|
has: _has,
|
||||||
};
|
CACHE_KEY,
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user