This commit is contained in:
2024-05-17 18:02:49 +08:00
parent 8407d51fb6
commit b5264dc222
4056 changed files with 308094 additions and 41932 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4,73 +4,190 @@
<!-- <public-module></public-module>
<z-nav-bar title="确认订单" bgColor="#3AB3AE" fontColor="#fff"></z-nav-bar> -->
<u-popup :show="show" mode="bottom">
<view class="common_address_box">
<z-nav-bar
title="我的收货地址"
bgColor="#f0f0f0"
fontColor="#333"
></z-nav-bar>
<view
class="common_address_box"
:style="`${
backState != 1000 ? 'padding-bottom: 180rpx' : 'padding-bottom: 100rpx'
}`"
>
<z-nav-bar
navFontAlign="left"
title="我的收货地址"
bgColor="#3AB3AE"
fontColor="#fff"
>
<template slot="right"></template>
</z-nav-bar>
<view
class=""
style="padding: 20rpx; background-color: #f9f9f9; height: 100%"
>
<!-- @longpress.native.stop="onLongPress" -->
<common-list
isCondition="true"
:dataList="addressList"
@hancleClick="handleClickTab"
isNoIcon="true"
@hancleClick="selectAddress"
label="name"
class="common_radius_box color_shandow"
style="background-color: #fff"
>
<template slot="rightSlot" slot-scope="slotProps">
<text class="fdButtonBox aui-text-success">{{
slotProps.row.content
}}</text>
<template slot="labelSlot" slot-scope="slotProps">
<view class="label_content AC_List">
<view style="width: 100%">
<view class="normal_logo">
{{ getName(slotProps.row.consigneeName) }}
</view>
<view :class="`right`">
<view class="normal_box">
<view class="normal_box_top">
<view class="user_info">
<text class="name">
{{ slotProps.row.consigneeName }}
</text>
<text class="tel">
{{ slotProps.row.consigneePhone }}
</text>
<text
v-if="slotProps.row.isDefault == 1"
class="isDefault"
>默认</text
>
</view>
<view class="curriulum_title"
>{{ slotProps.row.province }}{{ slotProps.row.city
}}{{ slotProps.row.county
}}{{ slotProps.row.detailAddress }}
</view>
</view>
</view>
<!-- 018F89 -->
<u-icon
class="editIcon"
name="edit-pen-fill"
color="#3ab3ae"
size="24"
@click.native.stop="handleClickEdit(slotProps.row)"
style="display: inline-block; margin-left: 10rpx"
></u-icon>
<u-icon
class="editIcon"
name="trash-fill"
color="red"
size="24"
@click.native.stop="handleClickDelete(slotProps.row.id)"
style="display: inline-block; margin-left: 10rpx"
></u-icon>
</view>
</view>
<view> </view>
</view>
</template>
<template slot="rightSlot" slot-scope="slotProps">
<view> </view>
</template>
</common-list>
</view>
</u-popup>
<view class="goods_nav_box">
<uni-goods-nav
:fill="true"
:options="buyOptions"
:button-group="customButtonGroup1"
@click="onHandleClickIcon"
@buttonClick="onHandleClickBuy"
/>
</view>
</view>
<u-modal
:show="showModal"
:title="modalInfo.title"
:content="modalInfo.content"
showCancelButton
@confirm="deleteAddress"
@cancel="hancleModalCancel"
></u-modal>
<!-- <edit-address
@fresh="handleFresh"
ref="commonAddress"
@selectAddress="selectAddress"
></edit-address> -->
</view>
</template>
<script>
import courseDescription from "@/pages/component/commonComponents/list";
import editAddress from "./edit.vue";
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
components: {
courseDescription, //课程说明
editAddress, //编辑收获地址
},
props: ["backState", "type"],
data() {
return {
isEdit: false,
showModal: false,
addressData: {
address: "天津市河东区桃园西里2单元222号房",
userName: "张花花",
phone: "18834844849",
},
show: false,
addressList:[
{
name:'111',
}
buyOptions: [
// {
// icon: 'chat',
// text: '客服'
// },
// {
// icon: "bars",
// text: "管理",
// // info: 2,
// infoBackgroundColor: "#007aff",
// infoColor: "#f5f5f5",
// },
// {
// icon: 'cart',
// text: '购物车',
// info: 2
// }
],
customButtonGroup1: [
{
with: 200,
text: "+ 添加收货地址",
backgroundColor: "linear-gradient(90deg, #3AB3AE 0%, #117e4c 100%)",
color: "#fff",
},
],
show: false,
addressList: [],
urlList: {
list: "book/userAddress/getUserAddress",
list: "common/userAddress/getUserAddress",
curriculumInfo: "app/phone.do?getCourseInfo",
detailInfo: "app/phoneDoctor.do?getTaiHuClassInfo_new",
delete: "common/userAddress/delete",
},
customButton: [
{
width: "340rpx",
text: "立即支付",
backgroundColor: "linear-gradient(90deg, #FE6035, #EF1224)",
backgroundColor: "linear-gradient(90deg, #3AB3AE 0%, #117e4c 100%)",
color: "#fff",
},
],
modalInfo: {},
};
},
onLoad(options) {
this.options = options;
this.getCourseDescriptionData();
this.getData();
// this.getUserInfo()
// this.getCateList()
},
@@ -80,79 +197,44 @@ export default {
},
onShow() {
this.selectPayIndex = 0;
this.getData();
},
computed: {
...mapState(["userInfo"]),
},
methods: {
open() {
this.show = true;
hancleModalCancel() {
this.showModal = false;
},
fnCopy(value, title) {
this.$commonJS.handleMakingPhoneCalls(value, title);
backClick() {
this.$emit("fresh");
},
handleFresh() {
this.getData();
},
onHandleClickIcon() {
this.isEdit = true;
},
onHandleClickBuy() {
uni.navigateTo({
url: "/pages/component/commonComponents/address/edit",
});
},
handleClickEdit(data) {
console.log("data at line 145:", data);
uni.navigateTo({
url: "/pages/component/commonComponents/address/edit?id=" + data.id,
});
// this.$refs.commonAddress.open(data.id);
},
gotoPhone() {
this.$commonJS.handleMakingPhoneCalls("022-24142321");
},
goBuyJie() {
// if (this.addressList.length == 0) {
// this.dizhiShow = true // 如果没有地址信息
// }
// if (!this.nowClick) {
// return
// }
this.nowClick = false;
setTimeout(() => {
this.nowClick = true;
}, 5000);
let youPre = {
id: "",
coupons: {
amount: 0,
name: "",
},
};
if (this.youhuiContent.id != undefined) {
youPre = this.youhuiContent;
}
let xiaBiao = [];
for (let i = 0; i < this.cartList.length; i++) {
xiaBiao.push({
productId: this.cartList[i].productId,
quantity: this.cartList[i].productAmount,
});
}
let data = {
buyType: this.typeId, //0- 商品页直接下单 1- 购物车结算
userId: this.userInfo.id, //下单人ID
shippingUser: this.adressMoRen.consigneeName, //收货人姓名
userPhone: this.adressMoRen.consigneePhone, //收货人手机号
// province: this.adressMoRen.areaidpathtext.split(' ')[0], //省
// city: this.adressMoRen.areaidpathtext.split(' ')[1], //市
// district: this.adressMoRen.areaidpathtext.split(' ')[2], //区
//address: this.adressMoRen.useraddress, //地址
paymentMethod: this.payType, //支付方式 2支付宝1微信3ios内购 4天医币购买
orderMoney: this.totalPrice, //订单金额
realMoney: this.realPrice, //实收金额
shippingMoney: this.farePrice, //运费
couponId: youPre.id, //优惠券Id
isSend: this.isSend,
couponName: youPre.coupons.name, //优惠券名称
districtMoney: youPre.coupons.amount, //优惠金额
orderStatus: 0, //订单状态
productList: xiaBiao, //订单列表商品
orderType: "order", //订单类型
addressId: this.adressMoRen.id, // 地址ID
};
deleteAddress() {
var data = {};
$http
.request({
// url: "book/buyOrder/buySave",
url: "book/buyOrder/placeOrder",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
url: `${this.urlList.delete}?id=${this.selectAddressId}`,
method: "Get", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
@@ -160,107 +242,39 @@ export default {
},
})
.then((res) => {
console.log("res at line 252:", res);
this.showModal = false;
if (res.code == 0) {
if (res.orderSn == null) {
uni.showToast({
title: "失败,请重新下单",
icon: "none",
image: "../../static/icon/ic_close.png",
});
} else {
if (this.payType == 2) {
// 常规支付
uni.showToast({
title: "正在支付",
icon: "loading",
});
setPay(
{
typePay: "alipay",
subject: "order",
totalAmount: res.money,
type: 2,
relevanceoid: res.orderSn,
customerId: this.userInfo.id,
},
(res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.switchTab({
url: "./orderList",
});
// uni.navigateTo({
// url: './orderList'
// });
}, 1000);
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../static/icon/ic_close.png",
});
// setTimeout(() => {
// uni.navigateTo({
// url: './orderList'
// });
// }, 1000)
}
}
);
} else if (this.payType == 1) {
// 微信支付
let data1 = {
orderSn: res.orderSn,
buyOrderId: null,
totalAmount: res.money,
};
setWXPay(data1, (res) => {
if (res.success) {
uni.showToast({
title: "支付成功",
});
setTimeout(() => {
uni.switchTab({
url: "./orderList",
});
}, 1000);
} else {
console.log(res);
if (res.data.errMsg.indexOf("User canceled") != -1) {
uni.showToast({
title: "用户取消支付",
icon: "none",
image: "../../static/icon/ic_close.png",
});
} else {
uni.showToast({
title: "支付失败",
icon: "none",
image: "../../static/icon/ic_close.png",
});
}
}
});
} else if (this.payType == 4) {
// 天医币支付
uni.showToast({
title: "购买成功",
icon: "success",
});
setTimeout(() => {
uni.switchTab({
url: "./orderList",
});
}, 1000);
}
}
this.getData();
}
});
},
handleClickDelete(id) {
this.modalInfo = { title: "提示信息", content: "确定要删除该地址吗?" };
this.selectAddressId = id;
this.showModal = true;
},
getName(name) {
console.log("name at line 140:", name);
if (name) {
if (name.length <= 2) {
return name;
} else {
return name.substring(0, 1);
}
}
},
open() {
this.getData();
},
fnCopy(value, title) {
this.$commonJS.handleMakingPhoneCalls(value, title);
},
gotoPhone() {
this.$commonJS.handleMakingPhoneCalls("022-24142321");
},
radioChange(index) {
this.selectPayIndex = index;
@@ -291,108 +305,48 @@ export default {
// fnLoadDataGrid();
// });
},
fnRelearn(oid, days, courseFee) {
//99和199课程复读一个月60三个月120; 299和399课程复读一个月80三个月180
//499和599课程复读一个月90三个月220; 699和799课程复读一个月100三个月248
var feeAs = [
[60, 120],
[80, 180],
[90, 220],
[100, 248],
];
var fee = 0;
if (courseFee < 206) {
fee = feeAs[0][days == 30 ? 0 : 1];
} else if (courseFee < 406) {
fee = feeAs[1][days == 30 ? 0 : 1];
} else if (courseFee < 606) {
fee = feeAs[2][days == 30 ? 0 : 1];
} else {
fee = feeAs[3][days == 30 ? 0 : 1];
}
this.modalInfo = {
title: "提示信息",
content:
"用户您好,该课程已到期,通过支付" +
fee +
"元,本门课程可获得" +
days +
"天延期学习时间,点击确认即完成自动扣费,感谢配合!",
};
this.taiHuClassInfo = {
taiHuClassOid: oid,
days: days,
fee: fee,
};
this.show = true;
// $aui.alert({
// title: ,
// content: '用户您好,该课程已到期,通过支付' + fee + '元,本门课程可获得' + days + '天延期学习时间,点击确认即完成自动扣费,感谢配合!',
// buttons: ['取消', '确认'],
// radius: 6,
// titleColor: '#ff3300',
// contColor: '#333',
// btnColor: ''
},
//课程详情
async gotoDetail(v) {
console.log(v);
var result = await this.$commonJS.getCheckCourseStatus({
oid: v.courseOid,
});
console.log("result at line 364:", result);
if (result.buyFlg == 0 && v.conditions != "01") {
this.$commonJS.showToast("请先购买课程");
return;
selectAddress(v) {
console.log("v at line 423:", this.type);
// 当前页面
// 在源页面中使用 uni.navigateBack 返回上一页面并传递参数
if (this.options.type == "order") {
uni.$emit("returnData", v);
uni.navigateBack({
delta: 1, // 返回上一级页面
});
}
uni.navigateTo({
// url: '../bookShop/commodityDetail?id=' + item.id
url: `/pages/curriculum/order/curriculum/detail?navTitle=${v.title}&title=${v.title}&oid=${v.courseOid}&conditions=${v.conditions}&detailOid=${v.detailOid}`,
});
// this.$emit("selectAddress", v);
},
//相关课程
goCourseDescription(v) {
console.log(v);
uni.navigateTo({
// url: '../bookShop/commodityDetail?id=' + item.id
url: `/pages/curriculum/order/curriculum/index?navTitle=${v.title}&title=${v.title}&oid=${v.oid}`,
});
},
async getCourseDescriptionData() {
async getData() {
console.log("this.userInfo.id at line 368:", this.userInfo.id);
var data = {};
var that = this;
console.log(this.$store.state, "11111111111");
this.$http
.post(this.urlList.list, {
customerType: "D",
token: uni.getStorageSync("token"),
customerOid: uni.getStorageSync("customerOid"),
oid: this.options.oid,
})
.then(async (res) => {
that.curriculumData = res.obj;
if (
that.curriculumData.productImageList == null ||
that.curriculumData.productImageList == ""
) {
this.swiperList.push(that.curriculumData.explainsImg);
} else {
that.swiperList = that.curriculumData.productImageList.split(",");
// for (var i = 0; i < imgList.length; i++) {
// this.swiperList.push(imgList[i])
// }
$http
.request({
// url: "book/buyOrder/buySave",
url: `${this.urlList.list}?userId=${this.userInfo.id}`,
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log("res at line 374:", res);
if (res.code == 0) {
this.addressList = res.list;
}
that.dataList = res.obj.correlatedList;
await that.getDetailInfo();
// that.relatedCoursesList = res.obj.correlatedList
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
// socket.init();
this.$forceUpdate();
// await that.getDetailInfo();
});
},
getPriceData() {
@@ -527,11 +481,6 @@ export default {
// curriculumInfo
this.detailInfo = {
content:
"<img src='http://oss.taihumed.com/other/null_20210528102528870.jpg' ></img> <img src='http://101.201.146.165:8088/curriculum/detailImg/curriculum_20170420143333621.png' ></img><p><p>没有中医基础想学中医难不难?中医学者治疗出现瓶颈怎么办?中西医究竟有什么不同呢?吴雄志教授将以全新的视角,完美整合中药学和西医学知识,让你领略当代中医生理学魅力。</p><p><br/><p></p><p><br/></p><p>【思考题】</p><p>1、简述中医的发展这些年出现了哪些变化</p><p>2、简述中西医学科的异同</p>",
};
// this.$http
// .post(this.urlList.detailInfo, {
// customerType
@@ -652,7 +601,7 @@ export default {
this.searchList = [];
this.showSearchList = false;
this.$nextTick(async () => {
await that.getCourseDescriptionData();
await that.getData();
this.$forceUpdate();
});
@@ -843,9 +792,114 @@ export default {
</script>
<style lang="scss" scoped>
/deep/.list_item {
// border-bottom: none;
padding-left: 0 !important;
padding-right: 0 !important;
}
.AC_List {
width: 100%;
overflow: hidden;
display: flex;
align-items: center;
background-color: #fff;
// justify-content: space-between;
}
.curriulum_title {
width: 100%;
font-weight: 500;
font-size: 28rpx;
white-space: wrap; /* 禁止文本换行 */
overflow: hidden;
// line-height: 40rpx;
// display: flex;
// align-items: center;
margin-top: 10rpx;
float: left;
margin-bottom: 5rpx;
color: #b0b0b0;
// padding: 20rpx;
box-sizing: border-box;
text {
margin-right: 10rpx;
}
}
.right {
width: calc(100% - 100rpx);
display: flex;
align-items: center;
}
.user_info {
width: 100%;
float: left;
display: flex;
margin-top: 10rpx;
align-items: center;
font-size: 32rpx;
font-weight: 800;
.name {
max-width: calc(100% - 300rpx);
white-space: nowrap; /* 禁止文本换行 */
overflow: hidden; /* 隐藏超出容器的文本 */
text-overflow: ellipsis; /* 使用省略号代替隐藏的内容 */
display: inline-block;
color: #333;
margin-right: 10rpx;
}
.tel {
color: #000;
font-size: 28rpx;
font-weight: 600;
}
}
.common_address_box {
width: 100vw;
height: 100vh;
background-color: #fff;
background-color: #fdfbfb;
}
.normal_box {
width: calc(100% - 60rpx);
height: auto;
float: left;
// overflow: hidden;
.normal_box_top {
width: 100%;
// display: flex;
height: auto;
margin-bottom: 40rpx;
}
.editIcon {
float: right;
}
}
.normal_logo {
width: 80rpx !important;
height: 80rpx !important;
border-radius: 80rpx;
background-color: #d8f8e4;
color: #3ab3ae;
font-size: 34rpx;
font-weight: bold;
text-align: center;
line-height: 80rpx;
float: left;
margin-right: 20rpx;
}
.isDefault {
color: #3ab3ae;
font-size: 22rpx;
font-weight: 600;
border: 1rpx solid #3ab3ae;
padding: 2rpx 10rpx;
border-radius: 6rpx;
line-height: 30rpx;
margin-left: 18rpx;
}
</style>

View File

@@ -26,7 +26,13 @@
</u-grid>
</scroll-view>
<u-divider v-else text="暂无数据哦~"></u-divider>
<u-empty v-else-if="noDataIcon&&isLoadingHide"
:mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`"
>
</u-empty>
<u-divider v-else text="暂无数据哦~"></u-divider>
</view>
</template>
@@ -36,7 +42,7 @@ import {
mapState
} from 'vuex';
export default {
props: ['dataList', 'label', 'isCondition', 'imgUrl','imgMode', 'className', 'col', 'defaultUrl', 'isScroll'],
props: ['dataList', 'label', 'isCondition', 'imgUrl','imgMode', 'className', 'col', 'defaultUrl', 'isScroll','isLoadingHide','noDataIcon'],
data() {
return {
@@ -75,18 +81,19 @@ export default {
width: 100%;
// padding: 20rpx 30rpx;
box-sizing: border-box;
font-size: 30rpx;
// border-bottom: 1rpx solid #e0e0e0;
position: relative;
justify-content: space-around;
}
.scroll-view-item:nth-child(2n-1) {
// background-color: #f0f0f0 !important;
// background-color: #f5f5f5 !important;
}
.rightArrow {
width: 30rpx;
height: 30rpx;
width: 40rpx;
height: 40rpx;
position: absolute;
right: 30rpx;
}
@@ -147,14 +154,14 @@ export default {
height: 146rpx;
border-radius: 10rpx;
margin-bottom: 10rpx;
// background-color: #919191;
background-color: #f5f5f5;
}
.book_name {
font-family: MicrosoftYaHei;
font-weight: 400;
font-weight: 600;
font-size: 23rpx;
color: #000000;
line-height: 23rpx;

View File

@@ -1,216 +1,209 @@
<template>
<view class="richDetail">
<!-- 公共组件-每个页面必须引入 -->
<view class="richDetail">
<!-- 公共组件-每个页面必须引入 -->
<view class="detail_title video_box">
<view
v-for="(v, i) in dataList"
class="video_item"
@click="handleClick(v)"
>
{{ v.type == "2" ? "音频" : "视频" }}{{ getNumber(i + 1) }}
</view>
</view>
<slot name="richHeadImg"></slot>
<view class="detail_title video_box">
<view v-for="(v,i) in dataList" class="video_item">
视频0{{ i+1 }}
</view>
</view>
<slot name="richHeadImg"></slot>
<!-- <view>{{ detailInfo.content }}</view> -->
</view>
<!-- <view>{{ detailInfo.content }}</view> -->
</view>
</template>
<script>
import $http from '@/config/requestConfig.js';
import {
mapState
} from 'vuex';
import $http from "@/config/requestConfig.js";
import { mapState } from "vuex";
export default {
props:['detailInfo','dataList'],
components: {
props: ["detailInfo", "dataList"],
components: {},
data() {
return {};
},
onLoad(options) {},
onHide() {},
computed: {
...mapState(["userInfo"]),
},
methods: {
getNumber(num) {
if (num >= 10) {
return num;
} else {
return `0${num}`;
}
},
data() {
return {
}
},
onLoad(options) {
handleClick(data) {
console.log("data at line 35:", data);
this.$emit("open", data);
},
onHide() {
},
computed: {
...mapState(['userInfo']),
},
methods: {
// 放大图片
previewImage(url) {
console.log(url)
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ['很抱歉,暂不支持保存图片到本地'],
success: function (res) {
// console.log(res,'+++++')
}
}
});
// 放大图片
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function (res) {
// console.log(res,'+++++')
},
},
// getSearch() {
// $http.request({
// url: "book/prescript/searchPrescript",
// method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// data: {
// loadAnimate: 'none', // 请求加载动画
// 'keywords': this.searchValue,
// type: this.currentCateIndex + 1
// },
// header: { //默认 无 说明:请求头
// 'Content-Type': 'application/json'
// },
// }).then(res => {
// console.log(res, '搜索结果')
// if (res.code == 0 && res.list.length >= 0) {
// this.showSearchList = true
// this.searchList = res.list
// } else {
// this.searchList = []
// }
// }).catch(e => {
// // this.dataList = []
// this.searchList = []
// console.log(e)
// })
// },
// search(res) {
// console.log(res, 'res')
// // uni.showToast({
// // title: '搜索:' + res,
// // icon: 'none'
// // })
// if (res == '') {
// this.showSearchList = false
// this.searchList = []
// } else {
// this.getSearch()
// }
// },
// input(res) {
// console.log('----input:', res)
// if (res == '') {
// this.searchList = []
// } else {
// this.getSearch()
// }
// },
// clear(res) {
// console.log('----clear:', res)
// // uni.showToast({
// // title: 'clear事件清除值为',
// // icon: 'none'
// // })
// this.searchValue = ''
// this.showSearchList = false
// },
// blur(res) {
// // console.log('----blur:', res)
// // if (res == '') {
// // this.showSearchList = false
// // this.searchList = []
// // } else {
// // this.getSearch()
// // }
// },
// focus(e) {
// console.log('----focus:')
// // uni.showToast({
// // title: 'focus事件输出值为' + e.value,
// // icon: 'none'
// // })
// // 等于1 就是有权限
// // this.showSearchList = true
// },
// cancel(res) {
// uni.showToast({
// title: '点击取消,输入值为:' + res.value,
// icon: 'none'
// })
// }
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
});
},
// getSearch() {
// $http.request({
// url: "book/prescript/searchPrescript",
// method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// data: {
// loadAnimate: 'none', // 请求加载动画
// 'keywords': this.searchValue,
// type: this.currentCateIndex + 1
// },
// header: { //默认 无 说明:请求头
// 'Content-Type': 'application/json'
// },
// }).then(res => {
// console.log(res, '搜索结果')
// if (res.code == 0 && res.list.length >= 0) {
// this.showSearchList = true
// this.searchList = res.list
// } else {
// this.searchList = []
// }
// }).catch(e => {
// // this.dataList = []
// this.searchList = []
// console.log(e)
// })
// },
// search(res) {
// console.log(res, 'res')
// // uni.showToast({
// // title: '搜索:' + res,
// // icon: 'none'
// // })
// if (res == '') {
// this.showSearchList = false
// this.searchList = []
// } else {
// this.getSearch()
// }
}
// },
// input(res) {
// console.log('----input:', res)
// if (res == '') {
// this.searchList = []
// } else {
// this.getSearch()
// }
// },
// clear(res) {
// console.log('----clear:', res)
// // uni.showToast({
// // title: 'clear事件清除值为',
// // icon: 'none'
// // })
// this.searchValue = ''
// this.showSearchList = false
// },
// blur(res) {
// // console.log('----blur:', res)
// // if (res == '') {
// // this.showSearchList = false
// // this.searchList = []
// // } else {
// // this.getSearch()
// // }
// },
// focus(e) {
// console.log('----focus:')
// // uni.showToast({
// // title: 'focus事件输出值为' + e.value,
// // icon: 'none'
// // })
// // 等于1 就是有权限
// // this.showSearchList = true
// },
// cancel(res) {
// uni.showToast({
// title: '点击取消,输入值为:' + res.value,
// icon: 'none'
// })
// }
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
};
</script>
<style lang="scss" scoped>
.commonPageBox{
padding:40rpx 0;
}
.contentBox{
.headImage{
margin-bottom: 20rpx;
}
.detail_title{
padding:0 40rpx 0;
font-size: 26rpx;
line-height: 65rpx;
font-weight: bold;
text-align: center;
box-sizing:border-box ;
margin-bottom: 20rpx;
overflow: hidden;
}
.rich_box{
padding: 20rpx; box-sizing: border-box;
p{
display: block;text-indent: 2em;
letter-spacing: 2px !important;
line-height: 46rpx;
}
}
}
.richDetail{
width: 100%;
height: 100%;
.commonPageBox {
padding: 40rpx 0;
}
.video_box{
width: 100%;
.video_item{
width: 24%;
margin-right: 1%;
float: left;
background:#018F89;
color: #fff;
text-align: center;
border-radius: 10rpx;
box-shadow: 0px 0px 6rpx 0px rgba(255,255,255,1);
}
.video_item:nth-child(4n){
margin-right: 0;
.contentBox {
.headImage {
margin-bottom: 20rpx;
}
.detail_title {
padding: 0 40rpx 0;
font-size: 26rpx;
line-height: 65rpx;
font-weight: bold;
text-align: center;
box-sizing: border-box;
margin-bottom: 20rpx;
overflow: hidden;
}
.rich_box {
padding: 20rpx;
box-sizing: border-box;
p {
display: block;
text-indent: 2em;
letter-spacing: 2px !important;
line-height: 46rpx;
}
}
}
</style>
.richDetail {
width: 100%;
height: 100%;
}
.video_box {
width: 100%;
.video_item {
width: 24%;
margin-right: 1%;
float: left;
background: #018f89;
color: #fff;
text-align: center;
border-radius: 10rpx;
box-shadow: 0px 0px 6rpx 0px rgba(255, 255, 255, 1);
}
.video_item:nth-child(4n) {
margin-right: 0;
}
}
</style>

View File

@@ -0,0 +1,134 @@
<template>
<view style="width: 100%; height: 100%">
<scroll-view @scrolltolower="lower" scroll-y="true" class="scroll-Y" v-if="dataList.length > 0">
<view
@click="gotoDetail(item)"
class="scroll-view-item list_item"
v-for="(item, index) in dataList"
:key="item.id"
:index="index"
style="align-items: flex-start"
>
<view
:class="['titleItem', '']"
:style="`width:${isNoIcon ? '100%' : 'calc(100% - 30rpx)'}`"
>
<slot name="leftSlot" :row="item" :item="item" :index="index"> </slot>
<template v-if="isCondition">
<slot name="labelSlot" :row="item"></slot>
</template>
<template v-else>
{{ item[label] }}
</template>
<slot name="rightSlot" :row="item"></slot>
</view>
<image
v-if="!isNoIcon"
src="@/static/icon/icon_right.png"
class="rightArrow"
style=""
></image>
</view>
</scroll-view>
<u-divider v-else text="暂无数据哦~"></u-divider>
</view>
</template>
<script>
import { mapState } from "vuex";
export default {
props: ["dataList", "label", "isCondition", "isNoIcon","pagination"],
data() {
return {};
},
onLoad() {},
onHide() {
// this.showSearchList = false
// this.searchList = []
},
computed: {
...mapState(["userInfo"]),
},
methods: {
lower(){
this.$emit('lower')
},
gotoDetail(data) {
console.log("index at line 53:", data);
this.$emit("hancleClick", data);
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
components: {},
};
</script>
<style lang="scss" scoped>
.list_item {
width: auto !important;
float: left !important;
padding: 20rpx 30rpx;
box-sizing: border-box;
// border-bottom: 1rpx solid #e0e0e0;
display: flex;
align-items: center;
justify-content: space-between;
// position: relative;
}
.list_item :last-child(1) {
border-bottom: none;
}
.scroll-view-item:nth-child(2n-1) {
background-color: #f5f5f5 !important;
}
.rightArrow {
width: 30rpx;
height: 30rpx;
// position: absolute;
// right: 30rpx;
// top: 20rpx;
}
.scroll-Y {
height: 100%;
}
.scroll-view_H {
white-space: nowrap;
width: 100%;
}
.scroll-view-item {
// height: 300rpx;
// line-height: 300rpx;
// text-align: center;
// font-size: 36rpx;
}
.scroll-view-item_H {
display: inline-block;
width: 100%;
// height: 300rpx;
// line-height: 300rpx;
// text-align: center;
// font-size: 36rpx;
}
.titleItem {
width: calc(100% - 30rpx);
}
/deep/.scroll-view-item:nth-child(2n-1) {
background-color: transparent !important;
}
.list_item:last-child{
border-bottom: none !important;
}
</style>

View File

@@ -2,7 +2,7 @@
<view style="width: 100%; height: 100%">
<scroll-view @scrolltolower="lower" scroll-y="true" class="scroll-Y" v-if="dataList.length > 0">
<view
@click="gotoDetail(item)"
@click="gotoDetail(item,index)"
class="scroll-view-item list_item"
v-for="(item, index) in dataList"
:key="item.id"
@@ -16,13 +16,13 @@
<slot name="leftSlot" :row="item" :item="item" :index="index"> </slot>
<template v-if="isCondition">
<slot name="labelSlot" :row="item"></slot>
<slot name="labelSlot" :row="item" :rowIndex="index"></slot>
</template>
<template v-else>
{{ item[label] }}
</template>
<slot name="rightSlot" :row="item"></slot>
<slot name="rightSlot" :row="item" :rowIndex="index"></slot>
</view>
<image
v-if="!isNoIcon"
@@ -32,6 +32,11 @@
></image>
</view>
</scroll-view>
<u-empty v-else-if="noDataIcon&&isLoadingHide"
:mode="noDataIcon"
:icon="`http://cdn.uviewui.com/uview/empty/${noDataIcon}.png`"
>
</u-empty>
<u-divider v-else text="暂无数据哦~"></u-divider>
</view>
</template>
@@ -39,7 +44,7 @@
<script>
import { mapState } from "vuex";
export default {
props: ["dataList", "label", "isCondition", "isNoIcon","pagination"],
props: ["dataList", "label", "isCondition", "isNoIcon","pagination",'noDataIcon','isLoadingHide'],
data() {
return {};
},
@@ -55,10 +60,10 @@ export default {
lower(){
this.$emit('lower')
},
gotoDetail(data) {
gotoDetail(data,index) {
console.log("index at line 53:", data);
this.$emit("hancleClick", data);
this.$emit("hancleClick", data,index);
},
},
onBackPress() {
@@ -74,6 +79,7 @@ export default {
.list_item {
width: 100%;
padding: 20rpx 30rpx;
font-size: 30rpx;
box-sizing: border-box;
border-bottom: 1rpx solid #e0e0e0;
display: flex;
@@ -85,12 +91,12 @@ export default {
border-bottom: none;
}
.scroll-view-item:nth-child(2n-1) {
background-color: #f0f0f0 !important;
background-color: #f5f5f5 !important;
}
.rightArrow {
width: 30rpx;
height: 30rpx;
width: 40rpx;
height: 40rpx;
// position: absolute;
// right: 30rpx;
// top: 20rpx;

View File

@@ -1,25 +1,21 @@
<template>
<view class="richDetail">
<!-- 公共组件-每个页面必须引入 -->
<view class="richDetail">
<!-- 公共组件-每个页面必须引入 -->
<view class="detail_title" v-if="detailInfo.title">{{ detailInfo.title }}</view>
<slot name="richHeadImg"></slot>
<view class="rich_box" v-if="detailInfo.content">
<rich-text :nodes="detailInfo.content" @click.stop="showPreview"
:data-nodes="detailInfo.content"></rich-text>
</view>
<!-- <view>{{ detailInfo.content }}</view> -->
<view class="detail_title" v-if="detailInfo.title">{{
detailInfo.title
}}</view>
<slot name="richHeadImg"></slot>
<view class="rich_box" v-if="detailInfo.content">
<rich-text
:nodes="detailInfo.content | formatRichText"
@click.stop="showPreview"
:data-nodes="detailInfo.content"
></rich-text>
</view>
<!-- <view>{{ detailInfo.content }}</view> -->
</view>
</template>
<script>
@@ -49,9 +45,65 @@ export default {
},
computed: {
...mapState(['userInfo']),
},
}, filters: {
/**
* 处理富文本里的图片宽度自适应
* 1.去掉img标签里的style、width、height属性
* 2.img标签添加style属性max-width:100%;height:auto
* 3.修改所有style里的width属性为max-width:100%
* 4.去掉<br/>标签
* @param html
* @returns {void|string|*}
*/
formatRichText(html) { //控制小程序中图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
'max-width:100%;');
return match;
});
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
newContent = newContent.replace(/\<img/gi,
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
return newContent;
},
// 时间格式化
formatDate(date) {
console.log(date)
let newDate = new Date(date);
let year = newDate.getFullYear();
let month = newDate.getMonth().toString().padStart(2, 0);
let day = newDate.getDay().toString().padStart(2, 0);
return year + '-' + month + '-' + day;
}
},
methods: {
formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {
match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
return match;
});
newContent = newContent.replace(/style="[^"]+"/gi, function (match, capture) {
match = match.replace(/width:[^;]+;/gi, 'max-width:100%;').replace(/width:[^;]+;/gi,
'max-width:100%;');
return match;
});
// newContent = newContent.replace(/<img[^>]*>/gi, function(match, capture) {
// match = match.replace(/<img[^>]*>/gi, "@click='1111'").replace(/<img[^>]*>/gi, "@click='1111'");
// return match;
// });
newContent = newContent.replace(/<br[^>]*\/>/gi, '');
newContent = newContent.replace(/\<img/gi,
'<img style="max-width:100%;height:auto;display:inline-block;margin:10rpx auto;"');
return newContent;
},
showPreview(e) {
console.log('e at line 56:', e)
@@ -63,12 +115,12 @@ export default {
for (var j = 0; j < imgs.length; j++) {
imgs[j].replace(/<img[^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
imgList.push(capture)
})
}
console.log('imgList.push at line 64:', imgList)
//最后一步就是所有图片放在预览的方法previewImage中就可以了
// uni.previewImage({
// current: imgList,
@@ -102,7 +154,7 @@ export default {
// getSearch() {
// $http.request({
// url: "book/prescript/searchPrescript",
// method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
// data: {
// loadAnimate: 'none', // 请求加载动画
// 'keywords': this.searchValue,
@@ -120,7 +172,7 @@ export default {
// this.searchList = []
// }
// }).catch(e => {
// // this.dataList = []
// // this.dataList = []
// this.searchList = []
// console.log(e)
// })
@@ -193,49 +245,55 @@ export default {
<style lang="scss" scoped>
.commonPageBox {
padding: 40rpx 0;
padding: 40rpx 0;
}
.contentBox {
.headImage {
margin-bottom: 20rpx;
}
.detail_title {
padding: 20rpx 40rpx 0;
font-size: 38rpx;
line-height: 64rpx;
font-weight: bold;
text-align: center;
box-sizing: border-box;
margin-bottom: 20rpx;
}
.headImage {
margin-bottom: 20rpx;
.rich_box {
padding: 20rpx;
box-sizing: border-box;
::v-deep img {
width: 100%;
}
.detail_title {
padding: 20rpx 40rpx 0;
font-size: 38rpx;
line-height: 64rpx;
font-weight: bold;
text-align: center;
box-sizing: border-box;
margin-bottom: 20rpx;
}
.rich_box {
padding: 20rpx;
box-sizing: border-box;
::v-deep img{
width: 100%;
}
p {
display: block;
text-indent: 2em;
letter-spacing: 2px !important;
line-height: 46rpx;
img {
// margin-left: -2em;
}
}
p {
display: block;
// text-indent: 2em;
letter-spacing: 2px ;
line-height: 46rpx;
img {
// margin-left: -2em;
}
}
}
}
.richDetail {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
</style>
.ql-size-small{
font-size:20rpx !important;
}
.ql-size-large{
font-size:36rpx !important;
}
.ql-size-huge{
font-size:64rpx !important;
}
</style>

View File

@@ -0,0 +1,327 @@
<template>
<view class="container commonPageBox commonDetailPage" style="height: auto !important;padding-bottom: 0 !important;">
<u-popup :show="show" mode="bottom" @close="close" class="popup_box">
<view class="popup_top">
<!-- @click="previewImage(selectGoodsData.productImages)" -->
<view class="product_image">
<image
:src="selectGoodsData.productImages"
mode="aspectFit"
class="goods_image"
></image>
</view>
<view class="title">已选{{ selectGoodsData.productName }}</view>
</view>
<view :class="`common_radius_box goods_box popup_content`">
<view class="title title_box"
><text class="title_price">{{ selectGoodsData.price }}</text
>
<u-icon
name="close"
color="#333"
size="18"
@click="close"
style="display: inline-block"
></u-icon
></view>
<view class="title title_list"
><text>商品列表{{ goodsList.length }}</text></view
>
<common-list
imgUrl="url"
isNoIcon
imgMode="aspectFit"
defaultUrl=""
:isCondition="true"
:dataList="goodsList"
@hancleClick="selectGoods"
label="title"
>
<template slot="labelSlot" slot-scope="slotProps">
<!-- isSelectGoods -->
<view
class="related_courses_name"
:class="`goods_item ${
selectGoodsData &&
selectGoodsData.productId == slotProps.row.productId
? 'isSelectGoods color_shandow'
: ''
}`"
>
<view class="image_box" style="margin-right: 10rpx">
<image
:src="slotProps.row.productImages"
mode="aspectFit"
class="goods_image"
></image>
</view>
<view :class="`goods_info `">
<view class="name">{{ slotProps.row.productName }}</view>
<view class="price" style="color: #3ab3ae"
>{{ slotProps.row.price }}</view
></view
>
</view>
<!-- <text v-if="slotProps.row.conditions!='03'">试听</text> -->
</template>
</common-list>
<view class="goods_nav_box">
<uni-goods-nav
:fill="true"
:options="buyOptions"
:button-group="customButtonGroup1"
@click="onHandleClickBuy"
@buttonClick="onHandleClickBuy"
/>
</view>
<!-- <view>
<text @click="handleClickClose">取消</text>
<text @click="handleClickGoBuy">立即购买</text>
</view>-->
</view>
</u-popup></view
>
</template>
<script>
import { mapState } from "vuex";
export default {
props: [
"goodsList",
"label",
"isCondition",
"imgUrl",
"imgMode",
"className",
"col",
"defaultUrl",
"isScroll",
"selectGoodsData",
"customButtonGroup1",
"buyOptions",
],
data() {
return {
show: false,
};
},
onLoad() {},
onHide() {
// this.showSearchList = false
// this.searchList = []
},
computed: {
...mapState(["userInfo"]),
},
methods: {
// 放大图片
previewImage(url) {
console.log(url);
uni.previewImage({
urls: [url],
longPressActions: {
itemList: ["很抱歉,暂不支持保存图片到本地"],
success: function (res) {
// console.log(res,'+++++')
},
},
});
},
close() {
this.show = false;
},
selectGoods(data) {
this.$emit("selectGoods", data);
},
open() {
this.show = true;
},
gotoDetail(v) {
this.$emit("hancleClick", v);
},
onHandleClickBuy() {
this.$emit("selectGoodsData", this.selectGoodsData);
this.$emit("onHandleClickBuy");
},
},
onBackPress() {
// #ifdef APP-PLUS
plus.key.hideSoftKeybord();
// #endif
},
components: {},
};
</script>
<style lang="scss" scoped>
.goods_item {
overflow: hidden;
display: flex;
align-items: center;
justify-content: space-between;
// margin-bottom: 20rpx;
padding: 10rpx 20rpx;
border: 2rpx solid #fff;
border-radius: 10rpx;
}
.title {
box-sizing: border-box;
// font-weight: bold;
margin-bottom: 40rpx;
padding-left: 20rpx;
}
.image_box {
width: 70rpx;
height: 70rpx;
float: left;
background-color: #f5f5f5;
}
.goods_image {
width: 100%;
height: 100%;
}
.goods_info {
width: calc(100%);
// padding: 10rpx 20rpx;
box-sizing: border-box;
// height: 100rpx;
display: flex;
align-items: center;
justify-content: space-between;
float: left;
.name {
font-size: 26rpx;
// font-weight: 600;
color: #333;
}
.price {
font-size: 26rpx;
color: #aaa;
}
}
.isSelectGoods {
color: #3ab3ae !important;
.name {
color: #3ab3ae !important;
}
.price {
color: #3ab3ae !important;
}
border: 2rpx solid #3ab3ae;
border-radius: 10rpx;
}
/deep/.list_item {
// border-bottom: none;
padding: 10rpx 0 !important;
padding-right: 0 !important;
}
.goods_image {
width: 100%;
height: 100%;
}
.curriulum_box {
margin-top: 20rpx;
width: 100%;
.curriulum_title_box {
display: flex;
align-items: center;
margin-bottom: 20rpx;
background-color: #fff;
.curriulum_title {
width: calc(100% - 80rpx);
font-size: 32rpx;
line-height: 40rpx;
padding: 20rpx;
box-sizing: border-box;
}
}
}
.goods_box {
background-color: #fff;
// margin-top: 20rpx;
// padding: 40rpx 30rpx;
box-sizing: border-box;
width: 100%;
.curriulum_title_box {
width: calc(100%) !important;
padding-bottom: 20rpx;
background-color: #fff;
.curriulum_title {
width: calc(100%);
font-weight: 600;
font-size: 34rpx;
// line-height: 40rpx;
// display: flex;
// align-items: center;
margin-top: 80rpx;
margin-bottom: 0rpx;
// padding: 20rpx;
box-sizing: border-box;
}
}
}
.popup_box {
padding-top: 30rpx;
background-color: transparent;
.popup_top {
display: flex;
align-items: center;
color: #fff;
margin-bottom: 20rpx;
padding: 0 20rpx;
.title {
margin-bottom: 0;
font-size: 30rpx;
font-weight: 600;
}
}
.popup_content {
padding-bottom: 140rpx;
}
/deep/.list_item {
// border-bottom: none;
border: none !important;
box-shadow: none !important;
}
.product_image {
width: 120rpx;
height: 120rpx;
border-radius: 10rpx;
background-color: #f5f5f5;
// margin: 0 auto;
}
}
/deep/.u-popup__content {
background-color: transparent !important;
}
/deep/.u-popup__content__close {
color: #fff !important;
}
.title_box {
display: flex;
align-items: center;
justify-content: space-between;
padding-left: 0;
.title_price {
color: #ef1224;
font-size: 40rpx;
font-weight: 700;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,337 @@
<template>
<view class="page container commonPageBox commonDetailPage">
<player
ref="player"
:videoId="videoId"
:userId="userId"
:apiKey="apiKey"
:verificationCode="verificationCode"
:customId="customId"
:autoPlay="autoPlay"
:lists="lists"
videoMode="fill"
qualityOrder="descending"
:barrageOpen="barrageOpen"
:settingBarrageMode="settingBarrageMode"
:logo="logo"
@onSendBarrage="toggleFixedFooter"
@onSettingBarrage="handleToggleBarrageSetting"
@onDownload="onDownload"
@changeVideo="changeVideo"
@requestAndroidDownloadPermission="requestAndroidDownloadPermission"
>
</player>
<!-- <video-list
v-if="showVideoList"
:pick-mode="pickMode"
:is-pushing="isPushing"
:lists="lists"
:currentVideo="videoId"
@listClick="changeVideo">
<template v-slot:title>
<view class="list-header">
<text class="list-title">课程目录</text>
<picker
mode="selector"
:value="selectedDefinition"
:range="definitions"
range-key="desp"
@change="handleDefinitionChange"
>
<view class="picker-inner">
<text class="select-text">{{ definitions[selectedDefinition].desp }}</text>
<image class="pick-icon" src="@/static/arrow-down-black@2x.png"></image>
</view>
</picker>
</view>
</template>
<template v-slot:footer>
<download-footer
:pick-mode="pickMode"
@changePickMode="changePickMode"
@downloadConfirm="downloadConfirm"
></download-footer>
</template>
</video-list> -->
</view>
</template>
<script>
import { setFullScreen } from "@/utils/tool.js";
import download from "@/mixins/download.js";
import Player from "@/components/player/player.vue";
import VideoList from "@/components/list/VideoList.nvue";
import downloadFooter from "@/components/download/downloadFooter.vue";
import { getList } from "@/api/list.js";
import { mapState, mapMutations } from "vuex";
const { platform } = uni.getSystemInfoSync();
import permision from "@/js_sdk/wa-permission/permission.js";
const definitions = [
{
quality: 20,
desp: "高清",
},
{
quality: 10,
desp: "清晰",
},
];
export default {
components: {
Player,
VideoList,
downloadFooter,
},
data() {
return {
videoId: "",
userId: "",
apiKey: "",
verificationCode: "",
customId: "",
lists: [],
showVideoList: true,
pickMode: false, // 批量下载选择模式
definitions,
selectedDefinition: 0,
logo: {
url: "https://www.bokecc.com/Site/Default/Uploads/kindeditor/image/20210207/logo6.png",
position: "tr", // 默认:左上 tr右上 bl: 左下 br: 右下
// width: '100px',
// height: '100px',
offsetX: "15rpx", // position垂直偏移量
offsetY: "15rpx", // position水平偏移量
},
autoPlay: false,
};
},
computed: {
...mapState({
// userId: state => state.baseInfo.userId,
// apiKey: state => state.baseInfo.apiKey,
// verificationCode: state => {
// if (Array.isArray(state.baseInfo)) {
// const item = state.baseInfo.find(i => i.userId === this.userId)
// if (item) return item.verificationCode
// } else {
// return state.baseInfo.verificationCode
// }
// },
// customId: state => {
// if (Array.isArray(state.baseInfo)) {
// const item = state.baseInfo.find(i => i.userId === this.userId)
// if (item) return item.customId
// } else {
// return state.baseInfo.customId
// }
// },
baseInfo: (state) => state.baseInfo,
isPushing: (state) => state.isPushing,
pipVideoId: (state) => state.pipInfo.videoId,
}),
},
watch: {
userId(newVal) {
console.log("watch userId", newVal);
if (newVal) {
if (Array.isArray(this.baseInfo)) {
const item = this.baseInfo.find((i) => i.userId === newVal);
if (item) {
this.apiKey = item.apiKey;
this.verificationCode = item.verificationCode;
this.customId = item.customId;
}
} else {
this.apiKey = this.baseInfo.apiKey;
this.verificationCode = this.baseInfo.verificationCode;
this.customId = this.baseInfo.customId;
}
}
},
},
onLoad(option) {
let _this = this;
this.videoId = option.videoId;
this.userId = option.userId;
if (!option.from) {
uni.$emit("removePIP");
}
getList((data) => {
this.lists = data.map((item) => {
if (!Array.isArray(this.baseInfo)) {
item.userId = this.baseInfo.userId;
}
return item;
});
console.log("getList", data);
});
uni.$on("setFullScreenStatus", (status) => {
this.showVideoList = !status;
});
},
onReady() {
uni.setNavigationBarColor({
frontColor: "#ffffff",
backgroundColor: "#282828",
success: () => {
console.log("设置导航条颜色成功");
},
fail: (e) => {
console.log("设置导航条颜色失败", e);
},
});
},
onShow() {
console.log("detail page onShow");
// if (this.$refs.player) {
// this.$refs.player.start()
// }
if (this.pipVideoId && this.pipVideoId !== this.videoId) {
this.setPipInfo({
videoId: "",
userId: "",
});
}
},
onHide() {
// if (this.$refs.player) {
// this.$refs.player.pause();
// }
},
onUnload() {
console.log("detail page Unload");
if (this.$refs.player && platform === "ios") {
this.$refs.player.destroy();
} else {
this.$refs.player.stop();
}
},
onBackPress(options) {
console.log("detail page onBackPress", options);
// 安卓端手势返回上一页,强制竖屏
setFullScreen(false);
if (options.from == "backbutton") {
uni.$emit("removePIP");
}
},
methods: {
...mapMutations(["setPipInfo"]),
changeVideo(item) {
this.videoId = item.videoId;
this.userId = item.userId;
},
changePickMode(tag) {
if (platform === "android") {
// this.requestAndroidPermission('android.permission.READ_EXTERNAL_STORAGE');
if (!tag) {
this.pickMode = tag;
} else {
this.requestAndroidPermission(
"android.permission.WRITE_EXTERNAL_STORAGE"
);
}
} else {
this.pickMode = tag;
}
},
downloadConfirm() {
try {
let list = JSON.parse(JSON.stringify(this.lists));
list = list.filter((item) => item.selected == true);
console.log("downloadConfirm", list);
// 补充清晰度配置
list = list.map((item) => {
item.definition = Number(
this.definitions[this.selectedDefinition].quality
);
return item;
});
this.pickMode = false;
if (list.length) {
setTimeout(() => {
uni.$emit("startDownload", list);
}, 300);
uni.showToast({
title: "文件已加入下载队列",
icon: "none",
position: "bottom",
});
}
} catch (e) {
console.log(e);
}
},
onDownload(videoId, quality) {
const list = JSON.parse(JSON.stringify(this.lists));
const item = list.find((video) => video.videoId === videoId);
item.definition = Number(quality);
if (item) {
setTimeout(() => {
uni.$emit("startDownload", item);
}, 300);
}
},
async requestAndroidPermission(permisionID) {
var result = await permision.requestAndroidPermission(permisionID);
var strStatus;
if (result === 1) {
strStatus = "已获得授权";
this.pickMode = true;
uni.$emit("getStoragePermission");
} else {
uni.showModal({
content: "下载需获取存储权限,请先手动开启",
showCancel: false,
success: (res) => {
if (res.confirm) {
permision.gotoAppPermissionSetting();
}
},
});
}
},
handleDefinitionChange(e) {
this.selectedDefinition = e.detail.value;
console.log("selectedDefinition", this.selectedDefinition);
},
requestAndroidDownloadPermission() {
this.requestAndroidPermission(
"android.permission.WRITE_EXTERNAL_STORAGE"
);
},
},
};
</script>
<style lang="stylus" scoped>
.page
width 100%
height 100vh
flex 1
.list-header
flex-direction: row
justify-content: space-between
align-items: center
margin-top 30rpx
margin-bottom 5rpx
.list-title
font-size: 30rpx
.picker-inner
flex-direction: row
align-items: center
.select-text
font-size: 26rpx;
font-weight: 600;
color: rgba(0,0,0,0.85);
.pick-icon {
margin-left: 8rpx;
width: 26rpx;
height: 15rpx;
}
</style>

View File

@@ -282,7 +282,7 @@
.map {
width: 750rpx;
height: 250px;
background-color: #f0f0f0;
background-color: #f5f5f5;
}
.line {