Commit 6af81378 authored by caimeng's avatar caimeng

用户隐私协议统一一下

parent 840efd1e
......@@ -9,28 +9,20 @@ export default {
},
onLaunch: async function () {
// 手机型号
uni.getSystemInfo({
success: function (res) {
uni.setStorageSync('modelApp', res.deviceBrand)
uni.setStorageSync('version', res.appVersion)
}
})
// 强制竖屏
plus.screen.lockOrientation("portrait-primary")
// 判断用户是否同意用户隐私协议,如果同意协议再获取设备信息等内容
// const isAgreePrivacy = plus.runtime.isAgreePrivacy();
// 同意了协议
// console.log(isAgreePrivacy, '是否同意了协议')
// // 同意了协议
// if (isAgreePrivacy) {
const common = uni.getStorageSync("m-headers")
if (!common && plus.os.name == 'iOS') {
loadNetwork()
loadDevice()
loadLocation()
loadUuid()
}
// loadNetwork()
// loadDevice()
// loadLocation()
// loadUuid()
// }
// 当前版本号
......@@ -41,7 +33,8 @@ export default {
} else {
versionNumber = plus.runtime.version;
}
console.log(versionNumber,'当前版本号')
console.log(versionNumber, '当前版本号')
// 存储所有请求的头部信息
uni.setStorage({ key: 'm-header-version', data: versionNumber });
})
......
......@@ -30,4 +30,5 @@ APP当中的资源文件在【远益典当】账户的OSS里面
### 其他
参考:
- [uniapp 全局数据(globalData)的设置,获取,更改](https://blog.csdn.net/qq_37128634/article/details/106059230)
\ No newline at end of file
- [uniapp 全局数据(globalData)的设置,获取,更改](https://blog.csdn.net/qq_37128634/article/details/106059230)
- [UNIAPP 吸顶功能](https://blog.csdn.net/weixin_46371234/article/details/120202491)
\ No newline at end of file
{
"version" : "1",
"prompt" : "template",
"prompt" : "none",
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"https://ddh.yyhock.com/appStatic/protocol/dd-user.html\">《服务协议》</a>和<a href=\"https://ddh.yyhock.com/appStatic/protocol/dd-private.html\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "同意并接受",
......
......@@ -2,19 +2,19 @@
<view>
<!-- 遮罩滚动锁定组件 -->
<page-meta :page-style="'overflow:' + (popupShow ? 'hidden' : 'visible')"></page-meta>
<uni-popup ref="upgradePopup" background-color="#fff" class="upgradePopup" @change="upgradePopupChange"
:mask-click="false">
<uni-popup ref="upgradePopup" background-color="#fff" class="upgradePopup" @change="upgradePopupChange" :mask-click="false">
<view class="rocket-content">
<view class="rocket-img"></view>
</view>
<view class="content-v-des">
<view class="content-v">v{{ appUpgeadeObj.versionName }}</view>
<view class="content-v">V{{ appUpgeadeObj.versionName }}</view>
<view class='content-text'>发现新版本</view>
<view class="title">
<!-- 更新内容 -->
<scroll-view class="info_desc_scroll" scroll-y="true">
<rich-text class='scroll-text' :nodes="appUpgeadeObj.content"></rich-text>
<rich-text v-if="appUpgeadeObj.content" class='scroll-text' :nodes="appUpgeadeObj.content"></rich-text>
</scroll-view>
</view>
</view>
......@@ -31,12 +31,12 @@
<button v-show='appUpgeadeObj.type == "IOS"' class="updated-button" type="warn"
@tap.stop="upgradeNow">立即升级</button>
</view>
<!-- v-if="progressBolean" -->
<!-- {{progressBolean}} -->
<view v-if="progressBolean" class="progress-bar">
<progress border-radius="90" font-size="24" activeColor="#DB4032" backgroundColor="#f0f0f0" show-info
:percent="progressData.percent" stroke-width="15" />
</view>
</uni-popup>
</view>
</template>
......
......@@ -2,8 +2,8 @@
"name" : "多典花",
"appid" : "__UNI__DE04B13",
"description" : "",
"versionName" : "1.0.6",
"versionCode" : 106,
"versionName" : "1.0.4",
"versionCode" : 104,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -125,7 +125,7 @@
}
},
"splashscreen" : {
"useOriginalMsgbox" : true,
"useOriginalMsgbox" : false,
"androidStyle" : "common"
}
},
......
......@@ -32,6 +32,7 @@
</template>
<script>
import { loadDevice, loadLocation, loadNetwork, loadUuid } from '@/utils/index.js'
export default {
name: "Agreement",
data() {
......@@ -53,6 +54,7 @@ export default {
methods: {
// 拒绝授权
handleReject() {
plus.runtime.disagreePrivacy();
if (uni.getSystemInfoSync().platform === 'ios') {
plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
} else if (uni.getSystemInfoSync().platform === 'android') {
......@@ -61,51 +63,24 @@ export default {
},
// 同意授权
handleSure() {
plus.runtime.agreePrivacy();
const that = this;
uni.setStorage({
key: "m-agreement",
data: 'true',
success: function () {
console.log('m-agreement缓存成功')
uni.setStorageSync('appStart', true)
loadNetwork()
loadDevice()
loadLocation()
loadUuid()
uni.navigateBack({
delta: 1
})
}
})
},
getAppVersion() {
const self = this
uni.getSystemInfo({
success: (res) => {
let platform = res.platform;
// 获取本机版本号
let type;
platform === "android" ? (type = "ANDROID") : (type = "IOS");
self.$request(`/pawn/setting/other/appVersion/${type}`, 'GET').then(res => {
if (res.success == true) {
let response = res.result.data;
let result = {};
result.versionCode = response.version;
result.versionName = response.versionName;
result.versionInfo = response.content || "暂无";
result.forceUpdate = response.forceUpdate;
result.downloadUrl = response.downloadUrl;
result.is_silently = response.is_silently || false;
result.platform = platform;
result.storeList = response.storeList || '';
result.title = response.title || '';
result.type = response.type || '';
uni.setStorageSync('appVersion-info', result)
// resolve(result);
}
})
}
});
},
// 初始化首页信息
async init() {
......
......@@ -12,7 +12,7 @@
position: fixed;
left: 0;
top: 0;
z-index: 1000;
z-index: 900;
width: 100vw;
min-height: 176rpx;
height: auto;
......
......@@ -19,8 +19,7 @@
<view class='hot-ative' @click="hotShow(item)">{{ item.title }}</view>
<view v-show="hotIndex != item.id" class='hot-icon'></view>
<view v-show='hotIndex == item.id' :class="showUP == false ? 'hot-icon-show-down' : 'hot-icon-show'"
@click="goUP(item.id)">
</view>
@click="goUP(item.id)"></view>
</view>
</view>
</view>
......@@ -67,10 +66,9 @@
<!-- 商品列表 -->
<scroll-view class='box-at-home' scroll-y="true" refresher-default-style="none"
@scrolltoupper="toupperTop" @scrolltolower="lowerMore">
<scroll-view class='box-at-home' scroll-y="true" refresher-default-style="none">
<view class='main-box' v-show="IndexList && IndexList.length > 0">
<view class='box-item' v-for="(item, index) in IndexList" :key="index" @click="goDetail(item)">
<view class='box-item' v-for="(item, index) in IndexList" :key="index" @click="GoDetail(item)">
<view class='item-top'>
<image :src="item.goodsImage" class='top-img'></image>
<i class='top-icon'></i>
......@@ -97,8 +95,9 @@
</view>
<!-- 更新 -->
<upgrade-Popup :app-upgeade-obj="appUpgeadeObj" v-if="appUpgeadeObj.downloadUrl"
@pause='pauseClick'></upgrade-Popup>
<template v-if="appUpgeadeObj && appUpgeadeObj.downloadUrl">
<upgrade-Popup :app-upgeade-obj="appUpgeadeObj" @pause='pauseClick'></upgrade-Popup>
</template>
</view>
</template>
......@@ -113,38 +112,47 @@ export default {
return {
IndexList: indexGoods,
index: cacheIndexData,
isFixed: false,
// 商品过滤
hotList: [
{ title: '浏览量', id: 0 },
{ title: '价格', id: 1 },
],
hotIndex: 0,
isFixed: false,
showUP: false,
headerHeight: 0,
scrollTop: 0,
params: {
current: 1,
size: 50,
total: 0,
sort: 'look_sum desc'
},
pageNum: 1,
pageSize: 50,
total: 0,
hasNextText: '上拉加载更多',
loadFlag: true,
hasNextPage: false,
sort: 'look_sum desc',
token: '',
appUpgeadeObj: {},
isFirstShow: true
// 吸顶
hasNextText: '上拉加载更多',
loadFlag: true,
hasNextPage: false,
token: '',
// 升级对象
appUpgeadeObj: {}
}
},
// 监听页面滚动
onPageScroll(e) {
console.log(e.scrollTop, this.Topdistance, '高度')
if (e.scrollTop > this.Topdistance) {
this.isFixed = true;
} else {
......@@ -152,13 +160,14 @@ export default {
}
},
async onLoad() {
this.isFirstShow = uni.getStorageSync('isFirstShow')
// 初始化首页数据
await ininIndex()
await this.searchGood();
await this.getAppVersion()
await this.initGoods();
await this.checkAppVersion()
// 设置页面滚动条位置
uni.pageScrollTo({
scrollTop: 0,
duration: 0
......@@ -175,7 +184,7 @@ export default {
// 初始化首页数据
await ininIndex()
await this.searchGood();
await this.initGoods();
// 首页流量埋点
this.buryingPoint('app:index_page_view')
},
......@@ -187,12 +196,8 @@ export default {
uni.getSystemInfo({
success: (res) => {
const query = uni.createSelectorQuery().in(this);
query.select("#box").boundingClientRect((data) => {
console.log("得到布局位置信息" + JSON.stringify(data));
console.log("节点离页面顶部的距离为" + data.top);
_this.Topdistance = data.top
console.log(_this.Topdistance, '元素的高度')
query.select("#box").boundingClientRect((data) => {
_this.Topdistance = data.top
}).exec();
},
......@@ -219,8 +224,6 @@ export default {
this.JumpToLogin()
} else {
if (item.tager == 'uni:/pages/indexfinance/index,tab') {
console.log(item.tager, '987')
this.Go('uni:/pages/web/web', 'tab')
} else {
this.Go(item.tager)
......@@ -229,13 +232,16 @@ export default {
}
},
containsWGTExtension(url) {
return /\.wgt$/i.test(url);
},
// 检查版本更新
getAppVersion() {
checkAppVersion() {
const self = this
uni.getSystemInfo({
success: (res) => {
console.log(res, '系统信息')
const appVersion = res.appWgtVersion
const appVersion = res.appVersion
let platform = res.platform;
// 获取本机版本号
let type;
......@@ -244,6 +250,7 @@ export default {
if (res.success == true) {
const response = res.result.data;
if (appVersion < response.versionName) {
const wgtType = self.containsWGTExtension(response.downloadUrl)
if (wgtType == true) {
......@@ -258,7 +265,7 @@ export default {
}
} else {
console.log('强更了')
console.log('强更了',response)
self.appUpgeadeObj = response
}
}
......@@ -273,83 +280,68 @@ export default {
this.appUpgeadeObj.downloadUrl = ''
},
goDetail(item) {
// 跳转到详情
GoDetail(item) {
// 首页流量埋点
this.buryingPoint('app:index_product_click')
uni.navigateTo({
url: '/pages/productDetails/productDetails?mydata=' + encodeURIComponent(JSON.stringify({ goodId: item.id }))
})
},
// 切换tab
hotShow(item) {
console.log(item.id, '7766')
this.hotIndex = item.id
if (item.id == 0) {
this.sort = 'look_sum desc'
this.params.sort = 'look_sum desc'
this.showUP = !this.showUP
} else {
this.sort = 'goods_money desc'
this.params.sort = 'goods_money desc'
this.showUP = !this.showUP
}
this.pageNum = 1
this.searchGood()
this.params.current = 1
this.initGoods()
},
goUP(val) {
// 首页流量埋点
this.buryingPoint('app:index_price_click')
this.showUP = !this.showUP
if (val == 0) {
//浏览量
if (this.showUP == false) {
this.sort = 'look_sum desc'
} else {
this.sort = 'look_sum asc'
}
} else {
//价格
if (this.showUP == false) {
this.sort = 'goods_money desc'
} else {
//倒序
this.sort = 'goods_money asc'
}
console.log(this.showUP, '日')
let sort;
switch (val) {
case 0:
if (!this.showUP) sort = 'look_sum desc'
else sort = 'look_sum asc'
break;
case 1:
if (!this.showUP) sort = 'goods_money desc'
else sort = 'goods_money asc'
break
}
this.pageNum = 1
this.searchGood()
this.params.sort = sort;
this.params.current = 1
this.initGoods()
},
// 查询商品
searchGood() {
const self = this
const { sort, pageSize, pageNum } = self
const params = {
"current": pageNum,
"size": pageSize,
"sort": sort
}
// 查询商品(初始化商品列表)
initGoods() {
const params = this.params;
const { current, size } = this.params
try {
self.$request('/pawn/category/getGoodsPage', 'POST', params).then(res => {
this.$request('/pawn/category/getGoodsPage', 'POST', params).then(res => {
const { total, records } = res.result
const hasNextPage = total - self.pageSize * self.pageNum > 0 ? true : false //是否有下一页
if (self.loadFlag) {
self.IndexList = self.IndexList.concat(records)
if (current > 1) {
this.IndexList = this.IndexList.concat(records)
} else {
self.IndexList = records
this.IndexList = records
}
const hasNextPage = total - size * current > 0 ? true : false //是否有下一页
this.hasNextPage = hasNextPage
uni.setStorageSync('indexGoods', JSON.stringify(records))
self.hasNextPage = hasNextPage
self.loadFlag = false
}).catch(err => {
console.log(err, '请求出错')
})
......@@ -360,10 +352,7 @@ export default {
},
toupperTop: function (e) {
console.log(e, '到顶了');
},
// 加载更多(该函数去掉了调用,因为不会有第二页的数据)
lowerMore: function (e) {
console.log(e, '触底了');
if (!this.hasNextPage) {
......@@ -373,10 +362,8 @@ export default {
})
return false;
}
if (this.loadFlag) return;
this.loadFlag = true,
this.pageNum = this.pageNum + 1
this.searchGood();
this.params.current = this.params.current + 1
this.initGoods();
},
//wgt更新
......@@ -432,9 +419,6 @@ export default {
}
}
})
},
containsWGTExtension(url) {
return /\.wgt$/i.test(url);
}
},
......
......@@ -2,6 +2,7 @@
<view class='my-page'>
<view class='my-top'>
<!-- 头部 -->
<view class='my-header'>
<image class='header-img' src='https://ddh.yyhock.com/ddhMall/my-icon.png'></image>
<view class='header-des'>
......@@ -10,7 +11,7 @@
<view class='des-text'>多典花承诺保护您的信息安全</view>
</view>
</view>
<!-- 登录状态 -->
<template v-if="isLogin">
<!-- 我的还款&申请记录 -->
......@@ -54,6 +55,8 @@
</view>
</template>
<!-- 未登录状态 -->
<template v-else>
<view class='my-box-s'>
......@@ -112,11 +115,6 @@
</view>
</template>
<!-- 联系我们 -->
<view class='my-footer'>
<view class='footer-btn' @click="goTel">
......@@ -185,13 +183,7 @@ export default {
// 初始化
init() {
const token = uni.getStorageSync('token')
console.log(token, 'tokens')
if (!token) {
this.userTel = ''
// return this.Go('uni:/pages/login/login')
} else {
this.initMy()
}
if (token) this.initMy()
},
// 初始化个人中心页面
initMy() {
......
......@@ -5,19 +5,10 @@
</template>
<script>
import { ininIndex,initIndexGoods, initSettings, initApp } from '@/utils/index'
import { ininIndex, initIndexGoods, initSettings, initApp } from '@/utils/index'
export default {
async onLoad() {
// 有网络了再弹窗
uni.getNetworkType({
success: async function (res) {
if (res.networkType !== 'none') {
this.init()
}
}
});
// 监听网络变化,如果
uni.onNetworkStatusChange(async (res) => {
if (res.isConnected) {
......@@ -25,7 +16,7 @@ export default {
await initIndexGoods()
await initSettings()
await initApp()
this.init()
}
})
......@@ -34,18 +25,19 @@ export default {
await initIndexGoods()
await initSettings()
await initApp()
if(uni.getStorageSync('APP-SETTING')) this.init()
this.init()
},
methods: {
init() {
const systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'ios') {
const isAgree = uni.getStorageSync('m-agreement')
if (!isAgree) {
try {
if (!uni.getStorageSync('m-agreement')) {
this.Go('uni:/pages/agreement/index')
}
} catch (err) {
console.log(err)
}
},
// 点击跳转到首页
start() {
......
......@@ -16,30 +16,23 @@ export const convertPromise = function (FnName, params = {}) {
})
});
}
export const initHeaderInfo = function () {
const modelApp = uni.getStorageSync('modelApp')
const versionNew = uni.getStorageSync('m-header-version')
let deviceName
if (plus.os.name == 'Android') {
deviceName = 'android'
} else {
deviceName = 'ios'
}
// 根据当前时间戳生成一个随机整数
var randomNum = new Date().getTime();
const commons = {
"appName": "DDH",
"appSourceId":modelApp,
"token": randomNum,
"device": deviceName,
"appVersion": versionNew,
}
return commons
}
// 初始化请求头的device参数信息
export const initHeaderDevice = function () {
const modelApp = uni.getStorageSync('modelApp')
let modelApp;
// 手机型号
uni.getSystemInfo({
success: function (res) {
modelApp = res.deviceBrand
}
})
// 获取版本号
let AppVersion = uni.getStorageSync('m-header-version');
console.log(AppVersion,'版本号')
const common = {
appName: 'DDH',
appSourceId: modelApp,
......@@ -53,29 +46,33 @@ export const initHeaderDevice = function () {
pushType: "1", //设备push接入类型(1. 小米PUSH,2. 极光PUSH)
electricQuantity: "", //电量
totalStorage: "", //存储总空间
availableStorage: "" //可用存储空间
availableStorage: "", //可用存储空间
token: new Date().getTime(),
device: plus.os.name,
appVersion: AppVersion,
};
const deviceInfo = uni.getStorageSync('m-device-info')
const networkInfo = uni.getStorageSync('m-network-info')
const locationInfo = uni.getStorageSync('m-location-info')
const loadUuid = uni.getStorageSync('m-load-udid')
let device = {};
let device = {...common};
if (deviceInfo) {
device = Object.assign(device, common, JSON.parse(deviceInfo))
}
if (networkInfo) {
if (networkInfo) {
device = Object.assign(device, common, JSON.parse(networkInfo))
}
if (locationInfo) {
if (locationInfo) {
device = Object.assign(device, common, JSON.parse(locationInfo))
}
if (loadUuid) {
if (loadUuid) {
device = Object.assign(device, common, JSON.parse(loadUuid))
}
if (deviceInfo && networkInfo && loadUuid && locationInfo) {
const headerDeviceInfo = {
...JSON.parse(deviceInfo),
......
import { initHeaderDevice, initHeaderInfo } from './header.js'
import { initHeaderDevice } from './header.js'
import api from '@/config/api.js'
const request = async (url, type, data) => {
const baseUrl = api.common
// 这里确保一定是可以获取得到的
const headerDevice = uni.getStorageSync('m-header-device')
const deviceInfo = uni.getStorageSync('m-device-info')
const tokenF = uni.getStorageSync('tokenFinance')
let rd = null
try {
if (!deviceInfo || tokenF == '' && plus.os.name != 'iOS') {
rd = initHeaderInfo()
} else {
if (headerDevice) {
rd = encodeURIComponent(headerDevice)
} else {
const common = initHeaderDevice()
if (common) {
rd = JSON.stringify(common)
}
}
}
} catch (err) {
console.log(err, 'congzhelizou')
let rd
if (headerDevice) {
rd = encodeURIComponent(headerDevice)
} else {
rd = JSON.stringify(initHeaderDevice())
}
return new Promise((resolve, reject) => {
const token = uni.getStorageSync('token')
const tokenFinance = uni.getStorageSync('tokenFinance')
......@@ -44,7 +30,12 @@ const request = async (url, type, data) => {
},
success: (res) => {
// #ifdef APP
console.log(res, 'response')
console.log('------------')
console.log(`${url}`, '接口地址')
if (res.data.result) console.log(res.data.result, '返回内容')
else console.log(res.data, '返回内容')
console.log('------------')
// #endif
const { data, statusCode } = res;
if (statusCode === 200) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment