Browse Source

Merge branch 'master' into v3.3

master
taozi 3 years ago
parent
commit
042f3ae6c4
  1. 11
      README.md
  2. 5
      main.js
  3. 8
      manifest.json
  4. 1
      package.json
  5. 55
      pages/user/promotion/Poster/index.vue
  6. 26
      utils/store/cookie.js

11
README.md

@ -5,27 +5,29 @@
- 已支持 HBuilderX 最新版
## 小程序安装步骤
- 先从私服上 clone 下来项目
- 下载 uni 的开发者工具 https://www.dcloud.io/hbuilderx.html
- 登录微信开发者工具打开 菜单 > 设置 > 安全设置 勾选服务端口为开启
- 当前项目下执行 npm install
- 当前项目下执行 npm install !!!!!!!!!必须执行,找不到模块都是因为这个原因导致的
- 命令行进入项目所在的目录,点击 hbuilderx > 菜单 > 运行 > 运行到小程序模拟器 > 微信开发者工具
- 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单位
- 由于需要兼容 app,尺寸单位由之前的 rem 改为 rpx,由于修改样式工作量太大并且容易出错,已将.css 更改为.less 并在其中以之前 rem 的单位\*100,获得新的 rpx 单位
- 如需修改样式问题,请编辑.less 的文件,请勿编辑.css 的文件
## git issuse 地址
https://gitee.com/guchengwuyue/yshopmall
### 请按照以下模板提交 issuse
标题:
H5/uni/后端代码/后台管理系统+简单描述
@ -42,7 +44,6 @@ windows/macOS/Linux
Ps:如果是 uni 出现问题,请具体描述是运行那个端小程序/android/ios
## 声明
- app 测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。
- 运行 app 项目 ios 需要安装 xcode,安卓需要装安卓的 sdk 以及安卓模拟器,建议安卓安装 genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费

5
main.js

@ -67,11 +67,10 @@ deviceType = 'routine'
import { wechat, clearAuthStatus, oAuth, auth, toAuth, pay, openAddress, openShareAll, openShareAppMessage, openShareTimeline, wechatEvevt, ready, wxShowLocation } from '@/libs/wechat'
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.set(CACHE_KEY, 1)
cookie.set(cookie.CACHE_KEY, 1)
}
var urlSpread = parseQuery()['spread']

8
manifest.json

@ -2,8 +2,8 @@
"name" : "yshopmall",
"appid" : "__UNI__C7A519E",
"description" : "",
"versionName": "1.0.1",
"versionCode": 1,
"versionName" : "1.0.2",
"versionCode" : 2,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@ -169,7 +169,8 @@
}
}
}
}
},
"ad" : {}
},
"quickapp" : {},
"mp-weixin" : {
@ -283,7 +284,6 @@
"router" : {
"mode" : "history"
},
"sdkConfigs" : {
"maps" : {
"qqmap" : {

1
package.json

@ -13,6 +13,7 @@
"animate.css": "^3.7.2",
"async-validator": "^3.2.4",
"dayjs": "^1.8.22",
"flyio": "^0.6.14",
"jweixin-module": "^1.6.0",
"miniapp-color-thief": "^1.0.5",
"vconsole": "^3.3.4",

55
pages/user/promotion/Poster/index.vue

@ -79,47 +79,7 @@ export default {
this.isDown = true
var downloadUrl = imgsrc
// if (!wx.saveImageToPhotosAlbum) {
// uni.showModal({
// title: '',
// content: '使',
// })
// that.openDialogVisible = true
// return
// }
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 () {
this.downloadIamge(this.info[this.activeIndex].wap_poster, 'poster' + this.activeIndex)
@ -134,9 +94,18 @@ export default {
})
},
success: function (res) {
uni.showModal({
title: '提示',
content: '保存成功',
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.showToast({
title: '保存成功!',
})
},
fail: () => {
uni.showToast({
title: '保存失败',
})
},
})
},
})

26
utils/store/cookie.js

@ -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;
function get(key) {
if (!key || !_has(key)) {
return '';
}
return uni.getStorageSync(key)
}
@ -16,29 +14,26 @@ function all() {
function set(key, data, time) {
if (!key) {
return;
return
}
uni.setStorageSync(key, data)
}
function remove(key) {
if (!key || !_has(key)) {
return;
return
}
uni.removeStorageSync(key)
}
function clearAll() {
const res = uni.getStorageInfoSync();
res.keys.map((item) => {
if (item == 'redirect' || item == 'spread') {
const res = uni.getStorageInfoSync()
res.keys.map(item => {
if (item == 'redirect' || item == 'spread' || item == CACHE_KEY) {
return
}
remove(item)
})
console.log(res)
// debugger
// uni.clearStorageSync()
}
function _has(key) {
@ -58,5 +53,6 @@ export default {
set,
remove,
clearAll,
has: _has
};
has: _has,
CACHE_KEY,
}

Loading…
Cancel
Save