Commit c0c3df06 authored by mengcuiguang's avatar mengcuiguang

添加返回键 标题

parent 8b6803fd
<template>
<u-popup bgColor="#00000000" customStyle="width:100%;height:100%;" :show="showDialog" mode="center"
:closeOnClickOverlay="false" @close="close">
<view class="container">
<view class="from">
<u--form labelPosition="left" :model="model1" :rules="rules" ref="form1">
<u-form-item labelWidth="140rpx" label="收货人" prop="formData.userName" ref="item1">
<u-input placeholder="请输入姓名" v-model="model1.formData.userName" border="bottom"></u-input>
</u-form-item>
<u-form-item labelWidth="140rpx" label="手机号码" prop="formData.userMobile" ref="item1">
<u-input placeholder="请输入手机号码" maxlength="11" v-model="model1.formData.userMobile"
border="bottom"></u-input>
</u-form-item>
<u-form-item labelWidth="140rpx" label="所在地区" prop="formData.region" ref="item1">
<view @click="showAddressPicker"
style="border-bottom: solid 1rpx #dadbde;padding: 10rpx;font-size: 28rpx;">
{{model1.formData.region?model1.formData.region:'选择省、市、区'}}
</view>
</u-form-item>
<u-form-item labelWidth="140rpx" label="详细地址" prop="formData.detail" ref="item1">
<u-input placeholder="小区楼栋/乡村名称" v-model="model1.formData.detail" border="bottom"></u-input>
</u-form-item>
</u--form>
</view>
<view class="btn-wrap">
<view class="cancel" @click="close">取消</view>
<view class="line"></view>
<view class="confirm" @click="confirm">确定</view>
</view>
</view>
<selectAddress ref='selectAddress' @selectAddress="successSelectAddress"></selectAddress>
</u-popup>
</template>
<script>
import {
message
} from '@/utils/fun';
export default {
name: "address-dialog",
props: {
data: {
type: Object,
default: () => {}
},
showModal: {
type: Boolean,
default: false
},
},
data() {
return {
showDialog: this.showModal,
model1: {
formData: {
userName: '',
userMobile: '',
region: '',
detail: '',
index: '',
type: 0
}
},
rules: {
'formData.userName': {
type: 'string',
required: true,
message: '请填写姓名',
trigger: ['blur', 'change']
},
'formData.userMobile': [{
required: true,
message: '请输入手机号',
trigger: ['change', 'blur'],
},
{
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说,返回true表示校验通过,返回false表示不通过
// uni.$u.test.mobile()就是返回true或者false的
return uni.$u.test.mobile(value);
},
message: '手机号码不正确',
// 触发器可以同时用blur和change
trigger: ['change', 'blur'],
}
],
'formData.region': {
type: 'string',
max: 100,
required: true,
message: '请输入地址',
trigger: ['blur', 'change']
},
'formData.detail': {
type: 'string',
max: 100,
required: true,
message: '请输入详细地址',
trigger: ['blur', 'change']
},
},
};
},
onReady() {
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
// #ifndef MP-WEIXIN
this.$refs.form1.setRules(this.rules)
// #endif
},
watch: {
showModal: {
handler: function(newVal, oldVal) {
this.showDialog = newVal;
}
},
data: {
handler: function(newVal, oldVal) {
this.model1.formData.userName = newVal.userName;
this.model1.formData.userMobile = newVal.userMobile;
this.model1.formData.region = newVal.region;
this.model1.formData.detail = newVal.detail;
this.model1.formData.index = newVal.index;
this.model1.formData.type = newVal.type;
}
}
},
methods: {
close() {
this.showDialog = false
this.$emit('dismiss');
},
confirm() {
if (this.model1.formData.userName == null || this.model1.formData.userName == '') {
message.notify('收货人不能为空')
return
}
if (this.model1.formData.userMobile == null || this.model1.formData.userMobile == '') {
message.notify('手机号不能为空')
return
}
if (this.model1.formData.region == null || this.model1.formData.region == '') {
message.notify('所在地区不能为空')
return
}
if (this.model1.formData.detail == null || this.model1.formData.detail == '') {
message.notify('详细地址不能为空')
return
}
this.showDialog = false
this.$emit('confirm', this.model1.formData);
},
showAddressPicker() {
this.$refs.selectAddress.show()
},
successSelectAddress(result) {
this.model1.formData.region = result
}
},
}
</script>
<style lang="scss">
.container {
margin: auto;
background-color: #fff;
border-radius: 20rpx;
}
.from {
margin: 20rpx;
width: 600rpx;
}
.btn-wrap {
border-top: solid 1rpx #ccc;
display: flex;
flex-direction: row;
margin-top: 20rpx;
font-size: 32rpx;
.line {
background-color: #ccc;
width: 2rpx;
height: 80rpx;
}
.cancel {
text-align: center;
width: 50%;
height: 80rpx;
line-height: 80rpx;
color: darkgray;
}
.confirm {
color: dodgerblue;
text-align: center;
width: 50%;
height: 80rpx;
line-height: 80rpx;
}
}
</style>
<template>
<u-popup :show="showPopup" mode="bottom" round="20rpx" :closeOnClickOverlay="true" @close="close">
<view class="container">
<view class="coupon-top flex">
<view>
请选择新的地址
</view>
<view @click="createNewAddress">
新增地址
</view>
</view>
<radio-group placement="column">
<scroll-view scroll-y class="scroll-wrap">
<view v-for="(item, index) in addressList" :key="index" class="coupon-wrap flex">
<view class="flex1 ml-42">
<view class="flex mt-10">
<view>{{item.userName}}</view>
<view class="ml-10">{{item.userMobile}}</view>
</view>
<view class="mt-10" style="color: #656565;">
{{item.region + item.detail}}
</view>
</view>
<radio color="#F8425A" @click="radioChange(index)" :checked="radiovalue==index" />
</view>
</scroll-view>
</radio-group>
<view v-if="addressList.length==0" class="emptyView">
暂无可用地址,添加新的地址
</view>
<view class="coupon-bottom">
<view class="btn-coupon" @click="confirm">确定</view>
</view>
</view>
</u-popup>
</template>
<script>
import {
navigateTo
} from '@/utils/fun';
const app = getApp();
export default {
name: "coupon-popup",
props: {
list: {
type: Array,
default: () => []
},
showPop: {
type: Boolean,
default: false
},
currentId: {
type: Number,
},
},
data() {
return {
radiovalue: 0,
cId: this.currentId,
showPopup: this.showPop,
addressList: this.list
};
},
watch: {
showPop: {
handler: function(newVal, oldVal) {
this.showPopup = newVal;
}
},
currentId: {
handler: function(newVal, oldVal) {
this.cId = newVal;
}
},
list: {
handler: function(newVal, oldVal) {
this.addressList = newVal;
for (let i = 0; i < this.addressList.length; i++) {
if (this.cId = this.addressList[i].id) {
this.radiovalue = i
return
}
}
}
}
},
methods: {
radioChange(val) {
if (this.radiovalue == val) {
this.radiovalue = -1
return
} else {
this.radiovalue = val
}
},
close() {
this.showPopup = false
this.$emit('dismiss');
},
confirm() {
if (this.radiovalue == -1) {
this.close()
return
}
this.showPopup = false
this.$emit('confirm', this.radiovalue);
},
createNewAddress() {
navigateTo(`/pagesA/address/address`)
}
}
}
</script>
<style lang="scss">
.container {
max-height: 1000rpx;
border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx;
background-color: #F0F1F5;
padding: 0;
}
.scroll-wrap {
max-height: 600rpx;
}
.emptyView {
height: 20%;
line-height: 300rpx;
text-align: center;
}
.coupon-wrap {
background-color: #fff;
margin: 20rpx 40rpx 10rpx 40rpx;
height: 180rpx;
border-radius: 30rpx;
padding-right: 30rpx;
justify-content: space-between;
.bottom {
position: absolute;
bottom: 26rpx;
padding: 0 40rpx;
}
}
.coupon-top {
border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx;
background-color: #fff;
font-weight: 700;
font-size: 30rpx;
height: 100rpx;
line-height: 100rpx;
padding: 0 30rpx;
justify-content: space-between;
}
.coupon-bottom {
background-color: #fff;
padding: 20rpx 0;
.btn-coupon {
margin: 0 auto;
color: #fff;
background-color: #F8425A;
border-radius: 50rpx;
width: 80%;
text-align: center;
height: 70rpx;
line-height: 70rpx;
}
}
</style>
<template>
<view class="count-time-down">{{ text }}</view>
</template>
<script>
export default {
name: 'count-time-down',
props: {
time: Number
},
data() {
return {
text: '00:00:00',
timespan: 0,
timer: undefined
};
},
created() {
this.timespan = this.time * 1000 + 1000;
this.countdown();
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
countdown() {
if (this.timespan < 0) {
this.text = '已上架'
this.$emit('finish');
} else {
this.timer = setInterval(() => {
let {
timespan
} = this;
this.timespan -= 1000;
if (this.timespan <= 0) {
this.$emit('finish');
this.text = '已上架'
} else {
let leftd = Math.floor(timespan / (1000 * 60 * 60 * 24)), //计算天数
lefth = ('00' + Math.floor((timespan / (1000 * 60 * 60)) % 24)).slice(-2), //计算小时数
leftm = ('00' + Math.floor((timespan / (1000 * 60)) % 60)).slice(-2), //计算分钟数
lefts = ('00' + Math.floor((timespan / 1000) % 60)).slice(-2); //计算秒数
this.text = (leftd > 0 ? leftd + '天' : '') + lefth + ':' + leftm + ':' +
lefts; //返回倒计时的字符串
}
}, 1000);
}
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.time-down {
display: inline-block;
margin-left: 10rpx;
}
</style>
<template>
<view class="count-time-down">{{ text }}</view>
</template>
<script>
export default {
name: 'count-time-down',
props: {
time: Number
},
data() {
return {
text: '00:00:00',
timespan: 0,
timer: undefined
};
},
created() {
this.timespan = this.time * 1000 + 1000;
this.countdown();
},
beforeDestroy() {
clearInterval(this.timer);
},
methods: {
countdown() {
if (this.timespan < 0) {
this.text = '已上架'
this.$emit('finish');
} else {
this.timer = setInterval(() => {
let {
timespan
} = this;
this.timespan -= 1000;
if (this.timespan <= 0) {
this.$emit('finish');
this.text = '已上架'
} else {
let leftd = Math.floor(timespan / (1000 * 60 * 60 * 24)), //计算天数
lefth = ('00' + Math.floor((timespan / (1000 * 60 * 60)) % 24)).slice(-2), //计算小时数
leftm = ('00' + Math.floor((timespan / (1000 * 60)) % 60)).slice(-2), //计算分钟数
lefts = ('00' + Math.floor((timespan / 1000) % 60)).slice(-2); //计算秒数
this.text = (leftd > 0 ? leftd + '天' : '') + lefth + '小时' + leftm + '分' +
lefts+'秒'; //返回倒计时的字符串
}
}, 1000);
}
}
}
};
</script>
<style lang="scss">
@import '@/scss/uni.scss';
.time-down {
display: inline-block;
margin-left: 10rpx;
}
</style>
<template>
<popup :show="showDialog" mode="center" :closeOnClickOverlay="false" :close="false">
<view style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
<view style="position: relative;width: 600rpx;height: 480rpx;">
<view style="font-size: 80rpx;font-weight: 777;color: #d43d33;
position: absolute;margin-top: 170rpx;z-index: 100;margin-left: 130rpx;">{{couponValue}}</view>
<image style="height: 480rpx;position: relative;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_companionx/bg_coupon_dialog.png"
mode="heightFix">
</image>
</view>
<image @click="confirm" style="width: 400rpx;height: 100rpx;margin-top: 40rpx; margin-bottom: 50rpx;"
src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg_companionx/bg_coupon_next.png" mode="widthFix">
</image>
<u-icon name="close-circle" color="#fff" size="30" @click="confirm"></u-icon>
</view>
</popup>
</template>
<script>
import {
message
} from '@/utils/fun';
export default {
name: "coupon-new",
props: {
couponResult: {
type: String,
default: '500元'
},
showModal: {
type: Boolean,
default: false
}
},
data() {
return {
showDialog: this.showModal,
couponValue: this.couponResult
};
},
onReady() {
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
// #ifndef MP-WEIXIN
this.$refs.form1.setRules(this.rules)
// #endif
},
watch: {
showModal: {
handler: function(newVal, oldVal) {
this.showDialog = newVal;
}
},
couponResult: {
handler: function(newVal, oldVal) {
this.couponValue = newVal;
}
}
},
methods: {
confirm() {
this.showDialog = false
}
},
}
</script>
<style lang="scss">
</style>
<template>
<u-popup :show="showPopup" mode="bottom" round="20rpx" :closeOnClickOverlay="true" @close="close">
<view class="container">
<view class="coupon-top">
可用优惠券
</view>
<radio-group placement="column">
<scroll-view scroll-y class="scroll-wrap">
<view v-for="(item, index) in couponList" :key="index" class="coupon-wrap">
<image src="../../static/bg-coupon-available.png" />
<view class="bottom">
<view style="color: #F8425A;font-size: 60rpx;">{{item.price}}</view>
<view class="ml-26" style="margin-right: 10rpx;">
<u-text color="#000" size="16" text="无门槛"></u-text>
<u-text color="#626262" size="12" :text="'有效期至'+item.overdueTime"></u-text>
</view>
<radio v-if="sRadio" color="#F8425A" @click="radioChange(index)"
:checked="radiovalue==index" />
</view>
</view>
</scroll-view>
</radio-group>
<view v-show="list.length==0" class="emptyView">
暂无可用优惠券
</view>
<view class="coupon-bottom">
<view class="btn-coupon" @click="confirm">确定</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
name: "coupon-popup",
props: {
list: {
type: Array,
default: () => []
},
showPop: {
type: Boolean,
default: false
},
showRadio: {
type: Boolean,
default: true
},
currentId: {
type: Number,
},
},
data() {
return {
sRadio: this.showRadio,
cId: this.currentId,
radiovalue: 0,
showPopup: this.showPop,
couponList: this.list,
};
},
watch: {
showPop: {
handler: function(newVal, oldVal) {
this.showPopup = newVal;
}
},
list: {
handler: function(newVal, oldVal) {
this.couponList = newVal;
for (let i = 0; i < this.couponList.length; i++) {
if (this.cId = this.couponList[i].id) {
this.radiovalue = i
return
}
}
}
}
},
methods: {
radioChange(val) {
if (this.radiovalue == val) {
this.radiovalue = -1
return
} else {
this.radiovalue = val
}
},
close() {
this.showPopup = false
this.$emit('dismiss');
},
confirm() {
this.showPopup = false
if (this.couponList.length != 0) {
this.$emit('confirm', this.radiovalue);
} else {
this.close()
}
}
}
}
</script>
<style lang="scss">
.container {
max-height: 800rpx;
border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx;
background-color: #F0F1F5;
padding: 0;
}
.scroll-wrap {
max-height: 600rpx;
}
.emptyView {
height: 300rpx;
line-height: 300rpx;
text-align: center;
}
.coupon-wrap {
width: 640rpx;
height: 220rpx;
margin: 20rpx auto;
position: relative;
image {
width: 640rpx;
height: 220rpx;
position: absolute;
top: 0;
}
.bottom {
position: absolute;
top: 40%;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 40rpx;
}
}
.coupon-top {
border-top-left-radius: 50rpx;
border-top-right-radius: 50rpx;
background-color: #fff;
font-weight: 700;
font-size: 30rpx;
height: 100rpx;
line-height: 100rpx;
padding-left: 30rpx;
}
.coupon-bottom {
background-color: #fff;
padding: 20rpx 0;
.btn-coupon {
margin: 0 auto;
color: #fff;
background-color: #F8425A;
border-radius: 50rpx;
width: 80%;
text-align: center;
height: 70rpx;
line-height: 70rpx;
}
}
</style>
<template>
<view class="wrapper" v-show="isShowMask" @click="hidden">
<transition name="content">
<view class="content_view" v-show="isShow" @click.stop="()=>{}">
<view class="title_view">
<view class="title">请选择所在地区</view>
<!-- <view class="close_view" @click="hidden">
<icon class="close_icon" :type="'clear'" size="26" />
</view> -->
</view>
<view class="select_top">
<view class="select_top_item" ref="select_top_item" v-for="(item,index) in dataList" :key="index"
@click="select_top_item_click(index)">
<text class="address_value">{{item}}</text>
</view>
<view class="indicator" :style="{ left: indicatorStyleLeft + 'px' }" ref="indicator"></view>
</view>
<swiper class="swiper" :current="currentIndex" @change="swiperChange">
<swiper-item v-for="(swiper_item,swiper_index) in dataList" :key="swiper_index">
<view class="swiper-item">
<scroll-view class="scroll-view-item" scroll-y="true">
<view class="address_item" v-for="(item,index) in cityAreaArray[swiper_index]"
:key="index" @click="address_item_click(swiper_index,index)">
<image v-if="selectIndexArr[swiper_index] === index" class="address_item_icon"
src="../../static/selectAddress/gou.png" mode=""></image>
{{item.name}}
</view>
</scroll-view>
</view>
</swiper-item>
</swiper>
</view>
</transition>
<view class="mask" @click="hidden" v-show="isShowMask"></view>
</view>
</template>
<script>
import cityData from '../../static/selectAddress/city.json'
export default {
data() {
return {
isShow: false,
isShowMask: false,
dataList: ['请选择'],
currentIndex: 0,
cityData: {},
cityAreaArray: [],
selectIndexArr: [],
indicatorStyleLeft: 16
};
},
methods: {
show() {
this.isShow = true
this.isShowMask = true
},
hidden() {
this.isShow = false
setTimeout(() => {
this.isShowMask = false
}, 200);
},
select_top_item_click(index) {
this.currentIndex = index
this.$nextTick(() => {
this.changeIndicator(index)
})
},
swiperChange(event) {
let index = event.detail.current
this.currentIndex = index
this.changeIndicator(index)
},
changeIndicator(index) {
/*
let itemWidth = this.$refs.select_top_item[index].$children[0].$el.offsetWidth
if (itemWidth > 80){
itemWidth = 80
}
let itemCenterX = 10 + index * 80 + itemWidth / 2
let indicatorWidth = this.$refs.indicator.$el.offsetWidth
this.$refs.indicator.$el.style.left = itemCenterX - indicatorWidth / 2 + 'px'
*/
let indicatorWidth = 30
const query = uni.createSelectorQuery().in(this);
let arr = query.selectAll('.select_top_item .address_value')
arr.fields({
size: true,
scrollOffset: false
}, data => {
let itemWidth = data[index]["width"] > 80 ? 70 : data[index]["width"]
let itemCenterX = 10 + index * 80 + itemWidth / 2
let left = itemCenterX - indicatorWidth / 2
console.log('changeIndicator', itemWidth, index)
this.indicatorStyleLeft = left
}).exec();
},
address_item_click(swiper_index, index) {
// console.log(swiper_index,index)
this.selectIndexArr.splice(swiper_index, 5, index)
//判断当前是否为最下一级
if (swiper_index === 0) { //第一级
let currentObj = this.cityData[index]
let city = currentObj.name
this.dataList.splice(swiper_index, 5, city)
this.dataList.splice(swiper_index + 1, 0, '请选择')
this.cityAreaArray.splice(swiper_index + 1, 1, currentObj["city"])
// console.log(this.dataList)
setTimeout(() => {
this.currentIndex = 1
this.changeIndicator(1)
}, 50);
} else {
let currentAreaArray = this.cityAreaArray[swiper_index]
let currentObj = currentAreaArray[index]
let area = currentObj["area"]
// console.log(currentAreaArray)
if (area !== undefined) {
let city = currentObj.name
this.dataList.splice(swiper_index, 5, city)
this.dataList.splice(swiper_index + 1, 0, '请选择')
this.cityAreaArray.splice(swiper_index + 1, 1, currentObj["area"])
setTimeout(() => {
this.currentIndex = swiper_index + 1
this.changeIndicator(swiper_index + 1)
}, 50);
} else { //是最下一级
let city = currentObj.name
this.dataList.splice(swiper_index, 1, city)
//选择成功返回数据
this.$emit("selectAddress", this.dataList.join(''))
this.$nextTick(() => {
this.changeIndicator(swiper_index)
})
setTimeout(() => {
this.isShow = false
}, 100);
setTimeout(() => {
this.isShowMask = false
}, 200);
}
}
}
},
created() {
this.cityData = cityData
this.cityAreaArray.push(cityData)
},
mounted() {
// this.changeIndicator(0)
}
}
</script>
<style lang="scss">
// 不换行
@mixin no-wrap() {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.wrapper {
background-color: rgba(0, 0, 0, 0.6);
z-index: 1999;
position: absolute;
top: -44rpx;
left: 0;
bottom: 0;
right: 0;
// opacity: 1;
transition: opacity 0.2s linear;
.content_view {
z-index: 999;
background: white;
position: absolute;
height: 80%;
left: 0;
bottom: 0;
right: 0;
border-top-left-radius: 20rpx;
border-top-right-radius: 20rpx;
.title_view {
margin-top: 40rpx;
// height: 8%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 $uni-spacing-row-sm;
.title {
font-size: uni-font-size-sm;
}
.close_view {
height: 60px;
width: 60px;
display: flex;
justify-content: center;
align-items: center;
}
}
.select_top {
// height: 6%;
display: flex;
justify-content: start;
align-items: center;
padding: 10px;
position: relative;
box-sizing: border-box;
.select_top_item {
width: 80px;
font-size: 14px;
@include no-wrap();
}
.indicator {
position: absolute;
width: 30px;
height: 2px;
background: $uni-color-error;
left: 16px;
bottom: 0;
transition: left 0.5s ease;
}
}
.swiper {
height: 80%;
position: relative;
left: 0;
top: 0;
bottom: 0;
right: 0;
.swiper-item {
height: 100%;
.scroll-view-item {
height: 100%;
padding: 0 10px;
.address_item {
padding: 5px 0;
font-size: 14px;
display: flex;
align-items: center;
.address_item_icon {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
}
}
}
}
.mask {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: $uni-text-color-grey;
opacity: 0.7;
}
}
.content-enter {
transform: translateY(100%);
}
.content-enter-to {
transform: translateY(0%);
}
.content-enter-active {
transition: transform 0.5s;
}
.content-leave {
transform: translateY(0%);
}
.content-leave-to {
transform: translateY(100%);
}
.content-leave-active {
transition: transform 0.5s;
}
</style>
......@@ -75,33 +75,33 @@
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/zs.png",
"xhdpi" : "unpackage/res/zs.png",
"xxhdpi" : "unpackage/res/zs.png",
"xxxhdpi" : "unpackage/res/zs.png"
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : "",
"xxxhdpi" : ""
},
"ios" : {
"appstore" : "unpackage/res/zs.png",
"appstore" : "",
"ipad" : {
"app" : "unpackage/res/zs.png",
"app@2x" : "unpackage/res/zs.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
"app" : "",
"app@2x" : "",
"notification" : "",
"notification@2x" : "",
"proapp@2x" : "",
"settings" : "",
"settings@2x" : "",
"spotlight" : "",
"spotlight@2x" : ""
},
"iphone" : {
"app@2x" : "unpackage/res/zs.png",
"app@3x" : "unpackage/res/zs.png",
"notification@2x" : "unpackage/res/zs.png",
"notification@3x" : "unpackage/res/zs.png",
"settings@2x" : "unpackage/res/zs.png",
"settings@3x" : "unpackage/res/zs.png",
"spotlight@2x" : "unpackage/res/zs.png",
"spotlight@3x" : "unpackage/res/zs.png"
"app@2x" : "",
"app@3x" : "",
"notification@2x" : "",
"notification@3x" : "",
"settings@2x" : "",
"settings@3x" : "",
"spotlight@2x" : "",
"spotlight@3x" : ""
}
}
},
......@@ -114,9 +114,9 @@
"delay" : 0,
"iosStyle" : "common",
"android" : {
"hdpi" : "unpackage/res/splashscreen/splash480×762.png",
"xhdpi" : "unpackage/res/splashscreen/splash720×1242.png",
"xxhdpi" : "unpackage/res/splashscreen/splash1080×1882.9.png"
"hdpi" : "",
"xhdpi" : "",
"xxhdpi" : ""
},
"ios" : {
"storyboard" : "unpackage/res/splash/LaunchScreen.storyboard_.zip"
......
......@@ -14,7 +14,7 @@
</image>
<image v-else class="tabs-image" src="/static/tab/index_unselected.png" mode="heightFix"></image>
</view>
剧场
剧场
</view>
<view :class="currentPage == 1?'tab active': 'tab'" :style="'padding-bottom:' + bottomSafePadding + 'px;'"
@click="tabChange(1)">
......@@ -83,23 +83,18 @@
}
},
onShow() {
// if (app.globalData.resetLogin && !this.isFirstLoad) {
// this.wxLogin()
// }
// this.isFirstLoad = false
// try {
// // 在子组件重写show()代替onShow()
// if (this.currentPage == 0) {
// this.$refs.index.show();
// } else if (this.currentPage == 1) {
// this.$refs.recommend.show();
// } else if (this.currentPage == 2) {
// this.$refs.user.show();
// }
// } catch (e) {
try {
// 在子组件重写show()代替onShow()
if (this.currentPage == 0) {
this.$refs.index.show();
} else if (this.currentPage == 1) {
this.$refs.recommend.show();
} else if (this.currentPage == 2) {
this.$refs.user.show();
}
} catch (e) {
// }
}
},
mounted() {
// 渲染完成 初始化首页数据
......@@ -113,18 +108,12 @@
this.loadComponentData();
},
loadComponentData() {
if (this.currentPage == 0) {
this.$refs.index.show();
this.$refs.recommend.hide();
this.$refs.user.hide();
} else if (this.currentPage == 1) {
if (this.currentPage == 0) {
this.$refs.index.show();
} else if (this.currentPage == 1) {
this.$refs.recommend.show();
this.$refs.index.hide();
this.$refs.user.hide();
} else if (this.currentPage == 2) {
this.$refs.user.show();
this.$refs.index.hide();
this.$refs.recommend.hide();
} else if (this.currentPage == 2) {
this.$refs.user.show();
}
},
showEditBarH(b) {
......
......@@ -4,8 +4,7 @@
<view class="content">
<swiper class="banner" style="margin-top: 20rpx;" :indicator-dots="true" :autoplay="true"
:interval="2000" :duration="500">
<swiper-item v-for="banner in bannerList" :key="banner.vedioId"
@click="handleBanner(banner.vedioId)">
<swiper-item v-for="banner in bannerList" :key="banner.vedioId" @click="handleBanner(banner)">
<image class="banner-img" :src="banner.tabImage" mode="aspectFill"></image>
</swiper-item>
</swiper>
......@@ -102,7 +101,7 @@
</z-paging>
<view v-if="newRecordBean==null"
<view v-if="newRecordBean!=null"
style="width: 97%;height: 150rpx;margin: 10rpx;opacity: 0.8;background-color: black;z-index: 20;position: absolute;bottom: 0;border-radius:10rpx;">
<view style="display: flex;margin-left: 10rpx;">
......@@ -110,9 +109,16 @@
<image style="border-radius:10rpx; width: 100rpx;height: 130rpx;"
src="http://sh.mints-id.com/vedioApp/vedio/ZhiZunLongZhu/zzlzshu.jpg" mode="aspectFill"></image>
<view style="margin: 20rpx;">
<view style="font-size: 30rpx; color: white;">标题</view>
<view style="font-size: 24rpx;margin-top: 6rpx;color: white;">上次观看至第一集</view>
<view style="font-size: 22rpx;color: gainsboro;">都市</view>
<view style="font-size: 30rpx; color: white;">{{newRecordBean.title}}</view>
<view style="font-size: 24rpx;margin-top: 6rpx;color: white;">上次观看至第{{newRecordBean.seeIndex}}</view>
<view style="font-size: 22rpx;"
v-if="newRecordBean.orderTags!=null&&newRecordBean.orderTags.length>0">
<scroll-view scroll-x="true">
<block v-for="t in newRecordBean.orderTags" :key="newRecordBean.orderTags">
<view style="display:inline-block;margin-right: 4rpx;">{{t}} </view>
</block>
</scroll-view>
</view>
</view>
</view>
......@@ -120,7 +126,7 @@
<image @click="handleBottomClose()"
style="width: 30rpx;height: 30rpx;display: flex;align-items: right;margin: 10rpx;"
src="../../static/index/ic_quit_white.png" mode="aspectFill"></image>
<view @click="handleBottomPlay(newRecordBean.vedioId)" style="width: 160rpx;height: 50rpx;background-color: red;border-radius:30rpx;color: white;font-size: 24rpx;justify-content: center;
<view @click="handleBottomPlay(newRecordBean)" style="width: 160rpx;height: 50rpx;background-color: red;border-radius:30rpx;color: white;font-size: 24rpx;justify-content: center;
align-items: center;display: flex;padding-bottom: 4rpx;margin-right: 20rpx;">
继续观看
</view>
......@@ -155,7 +161,6 @@
mixins: [common],
data() {
return {
showlip: false,
dataList: [],
bannerList: [],
newRecordBean: null,
......@@ -164,37 +169,38 @@
},
methods: {
show() {
// 轮播图
this.post({
url: '/vedio/topTabs',
showLoading: false,
success: ({
data
}) => {
this.bannerList = data.list;
}
});
// 排行榜
this.post({
url: '/vedio/orders',
showLoading: false,
success: ({
data
}) => {
this.topList = data.list;
}
});
// 最近观看剧
this.post({
// 轮播图
this.post({
url: '/vedio/topTabs',
showLoading: false,
success: ({
data
}) => {
this.bannerList = data.list;
}
});
// 排行榜
this.post({
url: '/vedio/orders',
showLoading: false,
success: ({
data
}) => {
this.topList = data.list;
}
});
// 最近观看剧
this.post({
url: '/vedio/newest',
showLoading: false,
success: ({
data
}) => {
if (data.list != null && data.list.length > 0) {
this.newRecordBean = data.list[0];
}
}
data: {},
showLoading: false,
success: ({
data
}) => {
if (data.vedio != null ) {
this.newRecordBean = data.vedio;
}
}
});
},
queryList(page, size) {
......@@ -213,29 +219,28 @@
}
});
},
handleBanner(vedioId) {
message.notify('vedioId=' + vedioId);
handleBanner(item) {
navigateTo(`/pagesC/video/videoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleInfo(item) {
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
navigateTo(`/pagesC/video/videoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleTop(item) {
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
navigateTo(`/pagesC/video/videoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleBottomPlay(vedioId) {
message.notify('vedioId=' + vedioId);
handleBottomPlay(item) {
navigateTo(`/pagesC/video/videoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleBottomClose() {
this.newRecordBean = null;
this.post({
url: '/vedio/colseNewest',
url: '/vedio/colseNewest',
data: {},
showLoading: false,
success: ({
data
}) => {}
});
this.newRecordBean = null;
}
}
};
......
......@@ -25,7 +25,8 @@
<script>
import {
message,
redirectTo
redirectTo,
uuid
} from '@/utils/fun.js';
import common from '@/mixins/common';
......@@ -55,7 +56,9 @@
wxlogin() {
let that = this
var obj = wx.getEnterOptionsSync()
var tempInviteUId = this.shareId;
var tempInviteUId = this.shareId;
// console.log('uuid(32)='+uuid(32,32));
var channel = '' // 渠道
var clueToken = '' // 归因参数
......@@ -106,6 +109,10 @@
}
});
},
fail: function(err) {
// 登录授权失败
message.notify('登录授权失败 错误码:'+err.code);
}
});
}
......
<template>
<view class="body">
<view
style="display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;padding-top: 30rpx;">
style="display: flex;flex-direction: row;align-items: center;margin: 20rpx;padding-left: 10rpx;padding-top: 40rpx;">
<image class="avatar" src="https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg/bg_my_vip.png"></image>
<view>
<view style="font-size: 26rpx;color: black;margin-left: 20rpx;">用户ID:{{userBean.idcode}}</view>
<view style="font-size: 32rpx;color: black;font-weight: 777;margin-left: 20rpx;">未登录</view>
<!-- <view style="font-size: 32rpx;color: black;font-weight: 777;margin-left: 20rpx;">未登录</view> -->
</view>
</view>
......
<template>
<view class="body">
<view class="body">
<status-title :showBack="true">会员界面</status-title>
<view class="section">
<view class="title">
选择套餐
......
<template>
<view class="body">
<view class="body">
<status-title :showBack="true">我的订单</status-title>
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view v-for="(item, i) in dataList" :key="i">
<view style="display: flex;flex-direction: row;justify-content:space-between;margin: 20rpx;background-color:white;border-radius:10rpx;padding: 20rpx;">
......
<template>
<view class="body">
<view class="body">
<status-title :showBack="true">观看记录</status-title>
<z-paging class="flex-1" ref="paging" v-model="dataList" @query="queryList">
<view style="font-size: 30rpx;font-weight: 777;margin-left: 12rpx;margin-top: 18rpx;">最近观看</view>
<view style="font-size: 30rpx;font-weight: 777;margin-left: 12rpx;margin-top: 10rpx;">最近观看</view>
<view v-for="(item, i) in dataList" :key="i">
<view style="display: flex;flex-direction: row;justify-content:space-between;margin: 20rpx;">
......@@ -77,8 +78,7 @@
});
},
handleInfo(item) {
message.notify('vedioId=' + item.vedioId);
// navigateTo(`/pagesA/product/product?data=` + encodeURIComponent(JSON.stringify(item)))
navigateTo(`/pagesC/video/videoDetail?data=` + encodeURIComponent(JSON.stringify(item)));
},
handleXing(item) {
var that = this;
......
......@@ -8,7 +8,18 @@ function toastFun(icon) {
icon
});
}
}
}
//获取随机id
export function uuid(len, binary) {
len = !len ? 36 : len;
binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
}).substring(0, len)
};
export const message = {
error: toastFun('error'),
......
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