22 changed files with 2772 additions and 12 deletions
@ -0,0 +1,130 @@ |
|||
/** |
|||
* 这里是uni-app内置的常用样式变量 |
|||
* |
|||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 |
|||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App |
|||
* |
|||
*/ |
|||
|
|||
/** |
|||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 |
|||
* |
|||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 |
|||
*/ |
|||
|
|||
/* 颜色变量 */ |
|||
|
|||
/* 行为相关颜色 */ |
|||
$uni-color-primary: #007aff; |
|||
$uni-color-success: #4cd964; |
|||
$uni-color-warning: #f0ad4e; |
|||
$uni-color-error: #dd524d; |
|||
|
|||
/* 文字基本颜色 */ |
|||
$uni-text-color: #333; //基本色 |
|||
$uni-text-color-inverse: #fff; //反色 |
|||
$uni-text-color-grey: #999; //辅助灰色,如加载更多的提示信息 |
|||
$uni-text-color-placeholder: #808080; |
|||
$uni-text-color-disable: #c0c0c0; |
|||
|
|||
/* 背景颜色 */ |
|||
$uni-bg-color: #ffffff; |
|||
$uni-bg-color-grey: #f8f8f8; |
|||
$uni-bg-color-hover: #f1f1f1; //点击状态颜色 |
|||
$uni-bg-color-mask: rgba(0, 0, 0, 0.4); //遮罩颜色 |
|||
|
|||
/* 边框颜色 */ |
|||
$uni-border-color: #c8c7cc; |
|||
|
|||
/* 尺寸变量 */ |
|||
|
|||
/* 文字尺寸 */ |
|||
$uni-font-size-sm: 12px; |
|||
$uni-font-size-base: 14px; |
|||
$uni-font-size-lg: 16; |
|||
|
|||
/* 图片尺寸 */ |
|||
$uni-img-size-sm: 20px; |
|||
$uni-img-size-base: 26px; |
|||
$uni-img-size-lg: 40px; |
|||
|
|||
/* Border Radius */ |
|||
$uni-border-radius-sm: 2px; |
|||
$uni-border-radius-base: 3px; |
|||
$uni-border-radius-lg: 6px; |
|||
$uni-border-radius-circle: 50%; |
|||
|
|||
/* 水平间距 */ |
|||
$uni-spacing-row-sm: 5px; |
|||
$uni-spacing-row-base: 10px; |
|||
$uni-spacing-row-lg: 15px; |
|||
|
|||
/* 垂直间距 */ |
|||
$uni-spacing-col-sm: 4px; |
|||
$uni-spacing-col-base: 8px; |
|||
$uni-spacing-col-lg: 12px; |
|||
|
|||
/* 透明度 */ |
|||
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 |
|||
|
|||
/* 文章场景相关 */ |
|||
$uni-color-title: #2c405a; // 文章标题颜色 |
|||
$uni-font-size-title: 20px; |
|||
$uni-color-subtitle: #555555; // 二级标题颜色 |
|||
$uni-font-size-subtitle: 26px; |
|||
$uni-color-paragraph: #3f536e; // 文章段落颜色 |
|||
$uni-font-size-paragraph: 15px; |
|||
|
|||
/** |
|||
* 下面为当前APP自己定义的公共样式 |
|||
*/ |
|||
.app-container { |
|||
padding: 20px; |
|||
font-size: 14px; |
|||
line-height: 24px; |
|||
} |
|||
|
|||
.u-block { |
|||
padding: 14px; |
|||
&__section { |
|||
margin-bottom: 10px; |
|||
} |
|||
&__title { |
|||
margin-top: 10px; |
|||
font-size: 15px; |
|||
color: $u-content-color; |
|||
margin-bottom: 10px; |
|||
} |
|||
&__flex { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
} |
|||
} |
|||
|
|||
// 使用了cell组件的icon图片样式 |
|||
.u-cell-icon { |
|||
width: 36rpx; |
|||
height: 36rpx; |
|||
margin-right: 8rpx; |
|||
} |
|||
|
|||
.u-page { |
|||
padding: 15px 15px 40px 15px; |
|||
} |
|||
|
|||
.u-demo-block { |
|||
flex: 1; |
|||
margin-bottom: 23px; |
|||
|
|||
&__content { |
|||
@include flex(column); |
|||
} |
|||
|
|||
&__title { |
|||
font-size: 14px; |
|||
color: rgb(143, 156, 162); |
|||
margin-bottom: 8px; |
|||
@include flex; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
/** |
|||
* getQueryString 二维码参数转换提取 |
|||
* 参数 |
|||
* url 二维码参数 |
|||
* name 需要提取的参数 |
|||
*/ |
|||
function getQueryString(url, name) { |
|||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)",'i'); |
|||
var r = url.substr(1).match(reg) |
|||
|
|||
if (r != null) { |
|||
|
|||
return r[2] |
|||
|
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
export { |
|||
getQueryString |
|||
} |
@ -0,0 +1,7 @@ |
|||
export default { |
|||
data() { |
|||
return { |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,2 @@ |
|||
uni.$u.props.gap.bgColor = '#f3f4f6' |
|||
uni.$u.props.gap.height = '10' |
@ -0,0 +1,16 @@ |
|||
const { |
|||
http |
|||
} = uni.$u |
|||
|
|||
export default { |
|||
login: (params, config = {}) => http.post('/login', params, { |
|||
custom: { |
|||
catchError: true, |
|||
showFailMessage: true |
|||
} |
|||
}), |
|||
sayhello: (params = {}) => http.get("/sayb", params), |
|||
|
|||
// 查看预警信息
|
|||
selectBusinessRiskInfo: (params = {}) => http.post("/v1/businessData/selectBusinessRiskInfo", params) |
|||
} |
@ -0,0 +1,150 @@ |
|||
<template> |
|||
|
|||
<!-- 扫码进入 携带参数 --> |
|||
|
|||
<view style="box-sizing: border-box;"> |
|||
<image src="../../static/bing_bg.png" style="width: 100vw;height: 50vw;z-index: 0;"></image> |
|||
|
|||
<view style="display: flex;flex-direction: column;margin-top: -10vw;box-sizing: border-box;"> |
|||
<view |
|||
style="display: flex;flex-direction: column;border-radius: 20rpx;background: #FFFFFF;z-index: 1;align-items: center;box-sizing: border-box;"> |
|||
<view style="margin: 15px;">绑定礼包卡</view> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content: space-between;box-sizing: border-box;width: calc(100vw - 60px);align-items: center;"> |
|||
<input maxlength="20" placeholder="请输入/扫码 提货编码" |
|||
style="font-size: 30rpx;flex: 1;background: #F8F8F8;border-radius: 5px;height: 40px;line-height: 40px;margin-right: 10px;padding-left: 10px;" |
|||
type="number" :value="page.code" @input="onKeyInput1" /> |
|||
<uni-icons type="camera-filled" color="#c0c4cc" size="22" style="flex-shrink: 0;" @click="scan" /> |
|||
</view> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content: space-between;box-sizing: border-box;width: calc(100vw - 60px);align-items: center;margin-top: 10px;"> |
|||
<input maxlength="6" placeholder="请输入提货密码" |
|||
style="font-size: 30rpx;flex: 1;background: #F8F8F8;border-radius: 5px;height: 40px;line-height: 40px;padding-left: 10px;" |
|||
type="number" :value="page.codeKey" @input="onKeyInput2" /> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view |
|||
style="margin: 30px;background-color: #fd3655;width: calc(100% - 60px);border-radius: 100rpx;height: 80rpx;display: flex;flex-direction: column;align-items: center;line-height: 80rpx;color: #FFFFFF;font-size: 36rpx;" |
|||
@click="save"> |
|||
绑定</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
page: { |
|||
code: '', |
|||
codeKey: '', |
|||
customerSid: '' |
|||
} |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
let _this = this; |
|||
wx.login({ |
|||
success: function(res) { |
|||
uni.request({ |
|||
// 组装请求地址 |
|||
url: getApp().globalData.wxSilentLoginURL + "?wxCode=" + res.code, |
|||
method: "GET", |
|||
header: { |
|||
'content-type': "application/x-www-form-urlencoded" |
|||
}, |
|||
data: { |
|||
"wxCode": res.code |
|||
}, |
|||
success: res => { |
|||
if (res.statusCode == 200) { |
|||
if (!res.data.success) { |
|||
if (res.data.code == "110") { |
|||
// 需要绑定手机号 |
|||
uni.reLaunch({ |
|||
url: '/pages/index/BindPhone?openid=' + |
|||
res.data.data.wxMpOpenid |
|||
}) |
|||
} else { |
|||
// _this.status = 'more' |
|||
} |
|||
} else { |
|||
// 成功后跳转主页 |
|||
getApp().globalData.sid = res.data.data.sid |
|||
_this.page.customerSid = getApp().globalData.sid |
|||
console.log("用户sid", getApp().globalData.sid) |
|||
} |
|||
} else { |
|||
// _this.status = 'more' |
|||
} |
|||
}, |
|||
fail: (err) => { |
|||
// _this.status = 'more' |
|||
} |
|||
}); |
|||
}, |
|||
fail: function(res) { |
|||
// _this.status = 'more' |
|||
} |
|||
}); |
|||
|
|||
if (options) { |
|||
console.log("options", options) |
|||
|
|||
const q = decodeURIComponent(options.q) // 获取到二维码原始链接内容 |
|||
console.log("二维码原始链接内容", q) |
|||
|
|||
var code = q.split('=')[1] |
|||
|
|||
// var code = this.getQueryString(q, 'code');// code是你二维码链接里面的参数名 |
|||
|
|||
console.log("提货卡编码", code) |
|||
this.page.code = code |
|||
} |
|||
|
|||
|
|||
}, |
|||
methods: { |
|||
onKeyInput1: function(event) { |
|||
this.page.code = event.target.value |
|||
}, |
|||
onKeyInput2: function(event) { |
|||
this.page.codeKey = event.target.value |
|||
}, |
|||
scan() { |
|||
// 只允许通过相机扫码 |
|||
let _this = this |
|||
uni.scanCode({ |
|||
onlyFromCamera: true, |
|||
success: function(res) { |
|||
_this.page.code = res.result.substring(res.result.length - 20, res.result.length) |
|||
} |
|||
}); |
|||
}, |
|||
save() { |
|||
if (this.stringIsEmpty(this.page.code) || this.page.code.length != 20) { |
|||
this.shortToast('请输入或扫描20位提货编码') |
|||
return |
|||
} |
|||
if (this.stringIsEmpty(this.page.codeKey) || this.page.codeKey.length != 6) { |
|||
this.shortToast('请输入6位提货密码') |
|||
return |
|||
} |
|||
let _this = this |
|||
_this.$api.cardBind(this.page).then((resp) => { |
|||
uni.switchTab({ |
|||
url: '/pages/card/card' |
|||
}) |
|||
uni.$emit('order', {}) |
|||
}).catch(e => { |
|||
_this.longToast(e.msg) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
@ -0,0 +1,99 @@ |
|||
<template> |
|||
<loading-state ref="pageView" @request="request"> |
|||
<view v-for="(item,index) in data" style="display: flex;flex-direction: column;margin-top: 15px; margin-left: 15px; margin-right: 15px;"> |
|||
<view |
|||
style="display: flex;flex-direction: column;border: 1px solid #e29a68;width: 100%;border-radius: 20rpx;margin-top: 8px;" |
|||
@click="detail(item.orderSid)"> |
|||
|
|||
<view class="use"> |
|||
<image style="width: 70rpx;height: 70rpx;position: absolute;right: 40px;" |
|||
src="../../static/card_line.png"></image> |
|||
<image src="../../static/gift.png" style="width: 30px;height: 30px;padding-left: 6px;"></image> |
|||
<view style="flex: 1;display: flex;flex-direction: column;z-index: 1;"> |
|||
<view style="font-size: 14px;padding: 2px;padding-left: 5px;padding-top: 7px;">{{item.code}} |
|||
</view> |
|||
</view> |
|||
|
|||
<view |
|||
style="flex-shrink: 0;padding: 9px;font-size: 13px;z-index: 1;font-weight: 600;">{{item.reserveDate}} |
|||
</view> |
|||
</view> |
|||
<view |
|||
style="display: flex;flex-direction: column; padding: 10px;border-bottom-left-radius: 20rpx;border-bottom-right-radius: 20rpx;background-color: #fdf0ee;"> |
|||
|
|||
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;"> |
|||
<text>礼包类型:</text> |
|||
<text>{{item.bagName}}</text> |
|||
</view> |
|||
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;margin-top: 5px;"> |
|||
<text>提货门店:</text> |
|||
<text>{{item.store}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</loading-state> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
page: { |
|||
sid: '', |
|||
}, |
|||
data: [ |
|||
|
|||
] |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.page.sid = options.sid |
|||
this.request() |
|||
}, |
|||
methods: { |
|||
request() { |
|||
let _this = this |
|||
_this.$api.orderByCardSid(this.page.sid).then((resp) => { |
|||
_this.data = resp |
|||
// 成功 2 |
|||
_this.$nextTick(() => { |
|||
_this.$refs.pageView.setLoadState(2) |
|||
}) |
|||
}).catch(e => { |
|||
// 错误 1 |
|||
_this.$nextTick(() => { |
|||
_this.$refs.pageView.setLoadState(1) |
|||
}) |
|||
}) |
|||
}, |
|||
detail(sid) { |
|||
uni.navigateTo({ |
|||
url: '/pages/card/card_record_detail?sid=' + sid |
|||
}) |
|||
}, |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.use { |
|||
display: flex; |
|||
flex-direction: row; |
|||
border-top-left-radius: 20rpx; |
|||
border-top-right-radius: 20rpx; |
|||
color: #FFF; |
|||
align-items: center; |
|||
background: linear-gradient(89.8deg, rgba(218, 51, 33, 1) -3.76%, rgba(237, 113, 53, 0) 300.05%); |
|||
} |
|||
|
|||
.bottom { |
|||
/* 加载背景图 */ |
|||
background-image: url(../../static/card_bg1.png); |
|||
/* 让背景图基于容器大小伸缩 */ |
|||
background-size: cover; |
|||
} |
|||
</style> |
@ -0,0 +1,138 @@ |
|||
<template> |
|||
|
|||
<loading-state ref="pageView" @request="request"> |
|||
|
|||
<view> |
|||
<image src="../../static/edit_bg.png" style="width: 100%;height: 40vw;z-index: 0;"></image> |
|||
<view style="display: flex;flex-direction: column;margin-top: -40vw;"> |
|||
<view style="display: flex;flex-direction: row;justify-content: space-between;align-items: center;"> |
|||
<view style="flex: 1;display: flex;flex-direction: column;z-index: 1;margin-left: 15px;"> |
|||
<view style="font-size: 17px;color: #FFFFFF;height: 8vw;line-height: 8vw;margin-top: 5vw;"> |
|||
{{data.state}} |
|||
</view> |
|||
<view |
|||
style="font-size: 12px;color: white;line-height: 7vw;height: 7vw;color: #f1f2f3;box-sizing: border-box;"> |
|||
{{data.name}} |
|||
</view> |
|||
<view style="font-size: 12px;color: white;line-height: 4vw;height: 4vw;color: #f1f2f3;"> |
|||
{{data.time}} |
|||
</view> |
|||
</view> |
|||
<image src='../../static/gift2.png' |
|||
style="width: 40px;height: 40px;padding-right: 30px;flex-shrink: 0;"> |
|||
</image> |
|||
</view> |
|||
|
|||
<view |
|||
style="background: #FFFFFF;border-radius: 20rpx;z-index: 1;height: 20vw;margin-left: 15px;margin-right: 15px;margin-top: 4vw;display: flex; |
|||
flex-direction: column; "> |
|||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 5px;"> |
|||
<image src="../../static/pName.png" style="width: 15px;height: 15px;margin-left: 15px;"></image> |
|||
<view style="margin-left: 15px;font-size: 14px;">{{data.pname}}</view> |
|||
</view> |
|||
|
|||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 5px;"> |
|||
<image src="../../static/pName.png" style="width: 15px;height: 15px;margin-left: 15px;"></image> |
|||
<view style="margin-left: 15px;font-size: 14px;">{{data.reserveDate}}</view> |
|||
</view> |
|||
<view style="display: flex;flex-direction: row;align-items: center;margin-top: 5px;"> |
|||
<image src="../../static/pName.png" style="width: 15px;height: 15px;margin-left: 15px;"></image> |
|||
<view style="margin-left: 15px;font-size: 14px;">{{data.store}}</view> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
<view style="background: #FFFFFF;border-radius: 20rpx;padding: 15px;margin: 10px 15px;"> |
|||
|
|||
<view |
|||
style="display: flex;flex-direction: row;align-items: center;border-bottom: 1rpx #f1f2f3 solid;padding-bottom: 10px;"> |
|||
<image src="../../static/mingxi.png" style="width: 15px;height: 15px;"></image> |
|||
<view style="margin-left: 10px;font-size: 14px;">商品明细</view> |
|||
</view> |
|||
<view v-for="(item,index) in data.goodsVos" |
|||
style="display: flex;flex-direction: row;margin-top: 15px;"> |
|||
<image :src="item.pic" style="width: 60px;height: 60px;flex-shrink: 0;"></image> |
|||
<view style="margin-left: 10px;margin-right: 10px;flex: 1;"> |
|||
<text class="text" style="font-weight: 500;">{{item.goods}} |
|||
</text> |
|||
<view style="font-size: 12px;color: #666666;">提货数量:{{item.orderNum}}</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view style="height: 60px;"></view> |
|||
</view> |
|||
|
|||
</loading-state> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
page: { |
|||
sid: '' |
|||
}, |
|||
data: { |
|||
time: "", |
|||
name: "", |
|||
pname: "", |
|||
state: "", |
|||
showBtn: false, |
|||
showRecord: false, |
|||
goodsVos: [] |
|||
} |
|||
} |
|||
}, |
|||
onLoad(options) { |
|||
this.page.sid = options.sid |
|||
this.request() |
|||
}, |
|||
methods: { |
|||
request() { |
|||
let _this = this |
|||
_this.$api.orderDetails(this.page.sid).then((resp) => { |
|||
_this.data = resp |
|||
_this.$nextTick(() => { |
|||
_this.$refs.pageView.setLoadState(2) |
|||
}) |
|||
}).catch(e => { |
|||
_this.$nextTick(() => { |
|||
_this.$refs.pageView.setLoadState(1) |
|||
}) |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.text { |
|||
white-space: normal; |
|||
text-overflow: -o-ellipsis-lastline; |
|||
overflow: hidden; |
|||
text-overflow: ellipsis; |
|||
display: -webkit-box; |
|||
-webkit-line-clamp: 2; |
|||
line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
|
|||
uni-page-body, |
|||
page { |
|||
background: #F1F2F3; |
|||
} |
|||
|
|||
.btn { |
|||
border: 1px solid; |
|||
padding-left: 30rpx; |
|||
padding-right: 30rpx; |
|||
padding-top: 12rpx; |
|||
padding-bottom: 12rpx; |
|||
border-radius: 50rpx; |
|||
height: 15px; |
|||
margin-left: 25rpx; |
|||
font-size: 26rpx; |
|||
} |
|||
</style> |
File diff suppressed because it is too large
@ -0,0 +1,334 @@ |
|||
<template> |
|||
<view style="padding: 30rpx;"> |
|||
<p style="text-align:center"> |
|||
<span style=";font-family:黑体;font-size:21px">汇融云眼程序隐私政策</span> |
|||
</p> |
|||
<p style="text-indent:28px; margin-top: 20rpx;"> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
<span style="font-family:微软雅黑">欢迎使用汇融云眼</span> |
|||
</span> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">。</span> |
|||
</p> |
|||
<p style="text-indent:28px"> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
请您务必仔细阅读和理解以下条款。若您一旦接受我公司产品或服务,则表示您同意接受我公司约定的以下各项条款的约束。若您不接受以下条款,请您立即停止使用我公司的产品及服务。 |
|||
</span> |
|||
</p> |
|||
<p style="text-indent:28px"> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
<span style="font-family:微软雅黑"> |
|||
为了使您充分理解本协议,本协议中与您的权益存在或可能存在重大关系的部分,我们已采用下划线、加粗等方式提示您注意。您点击 |
|||
</span> |
|||
"确认"或进行类似操作后,即表示您已同意我们按照本协议来使用和保护您的信息。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">一、声明与承诺</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(一)您理解并承诺,在您接受我公司的产品或服务前,您已充分阅读、理解并接受本协议的全部内容,您接受我公司的产品或服务,即表示您同意遵循本协议之所有约定。您理解并同意本协议规定的内容,并对相关法律法规有适当的了解,如您不能清楚地知晓或理解国家相关法律法规规定的内容,您应当咨询相关法律专业人士后再决定是否接受本协议。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(二)您在此确认知悉并同意,我公司有权依据国家法律法规及运营需求,对本协议条款不时地进行修改。我公司如更新本协议相关条款,将采用在“一诺云网”(www.enuoyun |
|||
.com)上公布,通知您该等修改、增加或删减的内容,以便您随时了解我公司产品或服务对您信息资料的收集和使用方法。一经公告,即视为上述内容已经通知到您。若您在本协议及各类规则变更后继续使用我公司产品或服务的,视为您已仔细认真阅读、充分理解并同意接受修改后的协议条款及各类规则。您有义务不时关注并阅读最新版的协议及网站公告等。如您不同意更新后的协议,应立即停止接受我公司产品或服务,否则视为您同意接受更新后的协议。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(三)您保证,作为自然人,在您同意接受本协议时,您已经年满16周岁;作为企业、事业单位等组织,您在中华人民共和国(“中国”)大陆地区(不含香港、台湾、澳门地区)合法开展经营活动或其他业务,或依照中国大陆地区(不含香港、台湾、澳门地区)法律登记注册成立;本协议内容不受您所属国家或地区法律的约束。不具备前述条件的,您应立即停止使用本软件提供的服务。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(四)我公司为遵守国家法律法规、向您提供服务、保护您的隐私及提升服务质量的目的,将按照本协议收集、使用您的信息(包括但不限于我公司认为了解您的需求和开展业务所必需的相关资料),本协议包含了我们收集、存储、保护、使用您的信息的条款,请您完整地阅读本协议项下各条款。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">二、信息收集</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
您在此不可撤销地同意并授权我公司收集以下信息: |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1.在您使用或接受我公司产品或服务时,我们会获取您的信息,包括但不限于基本信息、企业经营、商务交易信息等。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2.设备信息:我公司产品或服务会接收并记录您所使用的设备相关信息(例如设备型号、操作系统版本、设备设置、唯一设备标识符、设备环境等软硬件特征信息)、设备所在位置相关信息(例如IP |
|||
地址、GPS位置以及能够提供相关信息的WLAN接入点、蓝牙和基站等传感器信息)及您所授予的设备权限使用所获信息。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3.服务日志信息:当您接受我公司提供的产品或服务时,我们会自动收集您对我们服务的详细使用情况,作为有关网络日志保存。例如搜索查询内容、IP地址、浏览器的类型、电信运营商、使用的语言、访问日期和时间及您访问的网页记录等。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
4.发票信息:当您接受我公司提供的产品或服务时,我们会收集您在使用我公司产品或服务时,主动提供的以及通过自动化方式收集您在使用功能或接受服务过程中产生的增值税发票信息,以及开具增值税发票需要的业务信息。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
5.为了更好地为您提供服务,经您授权通过合法途径从我公司产品或我公司提供的服务过程中获取的其他您信息。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
6.在法律、行政法规允许的范围内采集的您的您信息。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">三、除外信息</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
您了解并同意,以下信息属于您自愿、主动在公开领域传播的信息,我公司存储、使用以下信息无需您授权: |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)您在使用我公司产品提供的搜索服务时,输入的关键字信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)您在使用我公司产品或接受我公司服务时所产生的信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3)您违反法律规定或违反我公司产品规则的行为,以及我公司已对您采取的措施。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">四、信息使用</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
一旦您使用我公司的产品或服务,我公司即有权依照自行设立的模型、模式、格式、规则、流程等对您的您信息进行整理、保存、加工。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
我公司将以高度的勤勉、审慎义务对待您信息,您不可撤销地授权并同意我公司将收集到的您信息用于以下用途: |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)将信息进行整合和处理,以便更好地为您提供服务,并依此对我公司的产品或服务进行改进,保存、整理、加工您信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)为达到服务您的目的,我公司可能通过使用您信息,向您提供您感兴趣的通知、营销活动及其他商业性电子信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3)经您明确同意并授权的其他用途; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
4)除本协议明确阐述和相关法律法规规定外,我公司不会向任何无关第三方提供、出售、出租或交易您的信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
5)我公司不允许任何第三方以任何手段收集、编辑、出售或者传播您的信息。如您从事上述活动,一经发现,我公司有权立即终止与该您的服务协议,并要求赔偿相应损失。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">五、信息保护</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
我们致力于维护您对我公司的产品或服务的信任,因此我公司会使用商业上合理的技术和其他措施,防止您信息的丢失和被盗用,并对您信息的保护情况不定期进行自查,记录自查情况,以便及时消除自查中发现的安全隐患。为尽可能地保护您的信息安全,我公司提请您注意: |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)我公司的产品账号均有安全保护功能,请妥善保管您的账号及密码信息。我公司将通过对您密码进行加密等安全措施确保您的信息不丢失,不被滥用和变造。尽管有前述安全措施,但同时也请您注意在信息网络上不存在“完善的安全措施”,您信息仍存在丢失、被盗用的可能,非因我公司过错而发生上述情况,我公司不承担任何责任; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)请您妥善保护自己的信息,仅在必要的情形下向他人提供。如您发现信息泄露,尤其是您的账户及密码发生泄露,请您立即联络客服,以便采取相应措施。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">六、服务使用限制</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(一)您在使用我公司产品或服务时,应遵守中华人民共和国相关法律法规,不将本服务用于任何非法目的,也不以任何非法方式使用我公司产品或服务。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(二)您不得利用我公司产品或服务从事侵害他人合法权益之行为, |
|||
否则我们有权拒绝提供相关服务,且您应承担所有相关法律责任,因此导致我公司受损的,您应承担赔偿责任。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(三)您理解并同意,我公司不对因下述任一情况导致的任何损害赔偿承担责任,包括但不限于利润、商誉、数据等方面的损失或其他无形损失的损害赔偿(无论我公司是否已被告知该等损害赔偿的可能性): |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1、如果您违反本协议的明文规定及精神,我们可能对您暂停、中断或终止提供本服务或其任何部分,但我们会在法律允许的范围内继续持有、保存您的您信息与使用本服务的记录。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2、在发现我公司产品或服务被异常使用,或对我公司产品或服务的使用有合理疑义,或对我公司产品或服务的使用有违反法律规定或本协议约定之虞时,我公司有权不经通知先行暂停或终止您对于本服务使用。具体可能导致暂停或终止本软件服务的情形包括但不限于: |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> 1)根据本协议的约定;</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)根据法律法规及法律文书的规定; |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> 3)根据有权机关的要求;</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
4)您使用我公司的产品或服务的行为涉嫌违反国家法律法规及行政规定的; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
5)本公司依据自行合理判断认为可能产生风险的; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
6)您遭到他人投诉,且对方已经提供了一定证据的。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(四)若您停止使用我公司的产品或服务,我公司仍可能保有您的相关信息。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(五)禁止反向工程、反向编译和反向汇编:您不得对本软件产品进行反向工程(ReverseEngineer)、反向编译(Decompile)或反向汇编(Disassemble),同时不得改动编译在程序文件内部的任何资源。除法律、法规明文规定允许上述活动外,您必须遵守此协议限制。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(六) |
|||
组件分割:我公司的产品或服务是作为一个单一产品而被授予许可使用,您不得将各个部分分开用于任何目的。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(七)个别授权:如需进行商业性的销售、复制、分发,包括但不限于软件销售、预装、捆绑等,必须获得我公司的书面授权和许可。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
(八)保留权利:本协议未明示授权的其他一切权利仍归我公司所有,您使用其他权利时必须获得我公司的书面同意。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">七、信息披露</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
我公司对您提供的信息严格保密,除具备下列情形外,不会向任何外部机构披露: |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)经过您事先同意而对外披露的您信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)应法律法规或公权力部门(如法院、政府部门、上级监管机构等执法机构)的要求而披露的您信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3)当我公司涉及合并、收购或资产出售等重大交易时,我公司有权依据交易的需要将您信息提供给交易相对方及交易各方聘请的各中介机构(包括但不限于律师、会计师等),我们会在任何信息进行转让或受其他隐私权政策约束之前,继续确保其保密性并及时通知受影响方; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
4)我公司可能会为了保护我公司产品自身、我公司员工和客户、我公司合作伙伴和其他公众的合法权利、利益和安全而披露您的信息; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
<span style="font-family:微软雅黑">八、</span> |
|||
Cookies的使用 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)在您未拒绝接受cookies的情况下,我公司的产品或服务会在您的客户端设定或取用cookies,以便您能登录或使用依赖于cookies的产品或服务。我公司的产品或服务使用cookies可为您提供更加周到的个性化服务,包括推广服务; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)您有权选择接受或拒绝接受cookies。您可以通过修改设置的方式拒绝接受cookies。但如果您选择拒绝接受cookies,则您可能无法登录或使用依赖于cookies的产品的网络服务或功能; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3)通过我公司的产品或服务所设cookies所取得的有关信息,将适用本协议。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">九、法律管辖和适用</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
本协议的订立、履行和解释及争议的解决均应适用中华人民共和国大陆地区适用之有效法律(但不包括其冲突法规则)。协议履行期间,凡因本协议引起的或与本协议有关的一切争议、纠纷,双方应首先友好协商解决;协商不成,您在此完全同意将纠纷或争议提交被告住所地人民法院管辖。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px">十、其他</span></p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
1)因台风、地震、海啸、洪水、战争、计算机病毒感染、黑客攻击、网络通信故障等不能预见、不能控制的不可抗力因素,造成本我公司产品不能正常向您提供服务而可能导致的损失,我公司不承担责任; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
2)您理解并同意,鉴于网络服务的特殊性,本协议可在您接受我公司产品或服务的过程中多次使用,未来为您提供服务时再次涉及到本协议服务内容时无需您另行签署; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
3)知识产权,与我公司产品及服务相关的任何内容和资源的知识产权均属于我公司所有。未经我公司书面明确许可,任何单位和个人不得以任何方式将我公司产品或服务之内容和相关资源作全部或部分复制、转载、引用、编辑; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
4)我公司产品或服务仅在您接受本协议条款并依此提供您信息且授权我公司产品按照上述条款的规定获取您信息的基础上提供服务,如您不同意本协议条款或不同意进行相应操作,则您将无法使用我公司产品的全部服务或相应部分服务; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
5)若本协议中任何一条无论因何种原因完全或部分无效或不具有执行力,本协议的其他条款仍继续有效; |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
6)您在本协议项下对我公司的产品或服务的授权,将视为对我公司的授权。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
7)您如需更正所提供的信息,或希望停止接受我公司的产品或服务,或对本协议有任何疑问,请通过联系我公司在线客服或直接拨打客服电话: |
|||
95113 的途径联系处理。 |
|||
</span> |
|||
</p> |
|||
<p> |
|||
<span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> |
|||
8)我公司对本协议有最终解释权。 |
|||
</span> |
|||
</p> |
|||
<p><span style="font-family: 微软雅黑;letter-spacing: 0;font-size: 14px"> </span></p> |
|||
<p><br /></p> |
|||
</view> |
|||
</template> |
|||
|
|||
<script></script> |
|||
|
|||
<style></style> |
@ -0,0 +1,115 @@ |
|||
<template> |
|||
|
|||
<!-- 有列表的时候用 :auto='false' 需要你在onload等调用reload方法 --> |
|||
<z-paging ref="paging" v-model="data" @query="queryList" :auto='true'> |
|||
|
|||
<view v-for="(item,index) in data" style="display: flex;flex-direction: column;margin-top: 15px; margin-left: 15px; margin-right: 15px;"> |
|||
<view |
|||
style="display: flex;flex-direction: column;border: 1px solid #e29a68;width: 100%;border-radius: 20rpx;margin-top: 8px;" |
|||
@click="detail(item.orderSid)"> |
|||
|
|||
<view class="use"> |
|||
<image style="width: 70rpx;height: 70rpx;position: absolute;right: 40px;" |
|||
src="../../static/card_line.png"></image> |
|||
<image src="../../static/gift.png" style="width: 30px;height: 30px;padding-left: 6px;"></image> |
|||
<view style="flex: 1;display: flex;flex-direction: column;z-index: 1;"> |
|||
<view style="font-size: 14px;padding: 2px;padding-left: 5px;padding-top: 7px;">{{item.code}} |
|||
</view> |
|||
</view> |
|||
|
|||
<view |
|||
style="flex-shrink: 0;padding: 9px;font-size: 13px;z-index: 1;font-weight: 600;">{{item.reserveDate}} |
|||
</view> |
|||
</view> |
|||
<view |
|||
style="display: flex;flex-direction: column; padding: 10px;border-bottom-left-radius: 20rpx;border-bottom-right-radius: 20rpx;background-color: #fdf0ee;"> |
|||
|
|||
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;"> |
|||
<text>礼包类型:</text> |
|||
<text>{{item.bagName}}</text> |
|||
</view> |
|||
<view style="width: 100%;display: flex;flex-direction: row;align-items: center;margin-top: 5px;"> |
|||
<text>提货门店:</text> |
|||
<text>{{item.store}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</z-paging> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
data: [] |
|||
} |
|||
}, |
|||
onLoad() { |
|||
uni.$on("order", (e) => { |
|||
// 相当与下拉刷新 |
|||
this.$refs.paging.reload(true); |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 分页的请求 |
|||
queryList(pageNo, pageSize) { |
|||
let _this = this |
|||
_this.$api.orderListByUserSid({ |
|||
"current": pageNo, |
|||
"size": pageSize, |
|||
"params": { |
|||
"userSid": getApp().globalData.sid |
|||
} |
|||
}).then((resp) => { |
|||
// 添加数据源 |
|||
this.$refs.paging.complete(resp.records) |
|||
}).catch(e => { |
|||
// 出错了,点击重试 |
|||
_this.$refs.paging.complete(false); |
|||
}) |
|||
}, |
|||
detail(sid) { |
|||
uni.navigateTo({ |
|||
url: '/pages/card/card_record_detail?sid=' + sid |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
.use { |
|||
display: flex; |
|||
flex-direction: row; |
|||
border-top-left-radius: 20rpx; |
|||
border-top-right-radius: 20rpx; |
|||
color: #FFF; |
|||
align-items: center; |
|||
background: linear-gradient(89.8deg, rgba(218, 51, 33, 1) -3.76%, rgba(237, 113, 53, 0) 300.05%); |
|||
} |
|||
|
|||
.gray { |
|||
filter: grayscale(100%); |
|||
-webkit-filter: grayscale(100%); |
|||
transition: filter 0.2s; |
|||
} |
|||
|
|||
.bottom { |
|||
/* 加载背景图 */ |
|||
background-image: url(../../static/card_bg1.png); |
|||
/* 让背景图基于容器大小伸缩 */ |
|||
background-size: cover; |
|||
} |
|||
|
|||
.oragin {} |
|||
|
|||
uni-page-body, |
|||
page { |
|||
background: #FFFFFF; |
|||
} |
|||
</style> |
@ -0,0 +1,13 @@ |
|||
// 引入配置
|
|||
import config from '@/common/config' |
|||
// 初始化请求配置
|
|||
uni.$u.http.setConfig((defaultConfig) => { |
|||
/* defaultConfig 为默认全局配置 */ |
|||
defaultConfig.baseURL = config.baseUrl /* 根域名 */ |
|||
return defaultConfig |
|||
}) |
|||
|
|||
module.exports = (vm) => { |
|||
require('./requestInterceptors')(vm) |
|||
require('./responseInterceptors')(vm) |
|||
} |
@ -0,0 +1,35 @@ |
|||
import conf from "@/common/config.js" |
|||
import token from '@/utils/auth.token.js' |
|||
/** |
|||
* 请求拦截 |
|||
* @param {Object} http |
|||
*/ |
|||
module.exports = (vm) => { |
|||
uni.$u.http.interceptors.request.use((config) => { // 可使用async await 做异步操作
|
|||
// 初始化请求拦截器时,会执行此方法,此时data为undefined,赋予默认{}
|
|||
config.data = config.data || {} |
|||
// 可以在此通过vm引用vuex中的变量,具体值在vm.$store.state中
|
|||
// console.log(vm.$store.state);
|
|||
|
|||
// 设置请求头中token的名字,以及token的值
|
|||
let _token = token.getToken() |
|||
let _tokenName = 'Authorization' |
|||
if (conf.tokenName) { |
|||
_tokenName = conf.tokenName |
|||
} |
|||
config.header[_tokenName] = _token |
|||
|
|||
// 设置针对响应结果的处理方式
|
|||
let _cus = { |
|||
showLoading: true, // 是否显示加载等待框
|
|||
loadingTitle: '加载中', // 加载等待框的提示文字
|
|||
showFailMessage: true, // 返回失败信息是否显示
|
|||
catchError: true, // 是否集中管理Catch,
|
|||
} |
|||
Object.assign(_cus, config.custom) |
|||
config.custom = _cus |
|||
|
|||
return config |
|||
}, (config) => // 可使用async await 做异步操作
|
|||
Promise.reject(config)) |
|||
} |
@ -0,0 +1,130 @@ |
|||
import conf from "@/common/config.js" |
|||
/** |
|||
* 响应拦截 |
|||
* @param {Object} http |
|||
*/ |
|||
module.exports = (vm) => { |
|||
uni.$u.http.interceptors.response.use((response) => { |
|||
/* 对响应成功做点什么 可使用async await 做异步操作*/ |
|||
|
|||
// 自定义参数
|
|||
let _cus = { |
|||
showLoading: true, // 是否显示加载等待框
|
|||
loadingTitle: '加载中', // 加载等待框的提示文字
|
|||
showFailMessage: true, // 返回失败信息是否显示
|
|||
catchError: true, // 是否集中管理Catch,
|
|||
} |
|||
if (response.config && response.config.custom) |
|||
Object.assign(_cus, response.config.custom) |
|||
|
|||
if (200 == response.statusCode) { |
|||
let data = response.data |
|||
if (_cus.catchError) { |
|||
if (data.success) { |
|||
return data.data |
|||
} else { |
|||
let loginTimeoutCode = "5000" |
|||
let loginTimeoutPage = "/pages/login/index" |
|||
if (conf.loginTimeoutCode) { |
|||
loginTimeoutCode = "" + conf.loginTimeoutCode |
|||
} |
|||
if (conf.loginTimeoutPage) { |
|||
loginTimeoutPage = conf.loginTimeoutPage |
|||
} |
|||
if (loginTimeoutCode === data.code) { |
|||
uni.showModal({ |
|||
title: '提示', |
|||
content: '登录过期或失效,请重新登录!', |
|||
showCancel: false, |
|||
success: function(res) { |
|||
uni.reLaunch({ |
|||
url: loginTimeoutPage |
|||
}) |
|||
} |
|||
}); |
|||
} else { |
|||
if (_cus.showFailMessage) { |
|||
uni.showToast({ |
|||
title: data.msg, |
|||
icon: 'none', |
|||
duration: 2000, |
|||
}) |
|||
} |
|||
} |
|||
return Promise.reject(data) |
|||
} |
|||
} else { |
|||
return data |
|||
} |
|||
} else { |
|||
console.log('response.statusCode--', response) |
|||
let em = { |
|||
"code": "" + response.statusCode, |
|||
"data": "", |
|||
"msg": "网络请求失败~", |
|||
"success": false, |
|||
"timestamp": new Date().getTime() |
|||
} |
|||
if (res.data) { |
|||
em.msg = res.data |
|||
} |
|||
if (_cus.showFailMessage) { |
|||
uni.showToast({ |
|||
title: em.msg, |
|||
icon: 'none', |
|||
duration: 2000, |
|||
}) |
|||
} |
|||
return Promise.reject(em) |
|||
} |
|||
|
|||
// const data = response.data
|
|||
// if (data.code !== 200) { // 服务端返回的状态码不等于200,则reject()
|
|||
// // 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
|
|||
// if (custom.toast !== false) {
|
|||
// uni.$u.toast(data.message)
|
|||
// }
|
|||
// // 如果需要catch返回,则进行reject
|
|||
// if (custom?.catch) {
|
|||
// return Promise.reject(data)
|
|||
// } else {
|
|||
// // 否则返回一个pending中的promise
|
|||
// return new Promise(() => {})
|
|||
// }
|
|||
// }
|
|||
// return data.data || {}
|
|||
}, (error) => { |
|||
console.log('request-fail', error) |
|||
let _opts = { |
|||
showLoading: true, // 是否显示加载等待框
|
|||
loadingTitle: '加载中', // 加载等待框的提示文字
|
|||
showFailMessage: true, // 返回失败信息是否显示
|
|||
catchError: true, // 是否集中管理Catch,
|
|||
} |
|||
if (error.config && error.config.custom) |
|||
Object.assign(_opts, response.config.custom) |
|||
let em = { |
|||
"code": "600", |
|||
"data": "", |
|||
"msg": "网络请求失败~", |
|||
"success": false, |
|||
"timestamp": new Date().getTime() |
|||
} |
|||
if (404 == error.statusCode) { |
|||
em.code = "404" |
|||
em.msg = "404,请求地址错误" |
|||
} |
|||
if (500 == error.statusCode) { |
|||
em.code = "500" |
|||
em.msg = "500,内部服务错误" |
|||
} |
|||
if (_opts.showFailMessage) { |
|||
uni.showToast({ |
|||
title: em.msg, |
|||
icon: 'none', |
|||
duration: 2000, |
|||
}) |
|||
} |
|||
return Promise.reject(em) |
|||
}) |
|||
} |
Loading…
Reference in new issue