Commit e4b94a5a by yuzhenWang

提交修复得520版本得bug,发布生产

parent 20e4495f
......@@ -7,7 +7,7 @@
</view>
<view class="login-code">
<input name="form.code" placeholder="输入验证码" v-model="code" type="number" maxlength="6" />
<text style="width: 250rpx;" @click="sendMessage()" :class="{'grey':disabledSendBtn}">{{sendCode}}</text>
<text style="width: 200rpx;" @click="sendMessage()" :class="{'grey':disabledSendBtn}">{{sendCode}}</text>
</view>
<view class="agree">
<label class="radio" style="padding-right: 10rpx;">
......@@ -146,7 +146,7 @@
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.content-box {
position: absolute;
// left:50%;
......
......@@ -5,15 +5,15 @@
</view>
<view class="courseDetailBox">
<view class="title">
<text style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{title}}</text>
<view style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{title}}</view>
<!-- <text class="detailBtn" @click="viewDetail()" v-if="isNeedViewDetail">订单详情></text> -->
</view>
<view class="summaryBox" v-if="summaryBox">
<text>{{summaryBox}}</text>
<view class="text-wrap">{{summaryBox}}</view>
</view>
<view class="dataBox" v-if="dataList">
<strong>{{dataList.coursePrice}}</strong>
<strong v-if="dataList.coursePrice == 0">免费</strong>
<view class="price" >{{dataList.coursePrice}}</view>
<text v-if="dataList.coursePrice == 0">免费</text>
<text v-if="dataList.coursePrice != 0">{{dataList.salesNumber}}人购买</text>
</view>
<view class="tagListBox" v-if="tagList || fileLecturerId">
......@@ -103,34 +103,44 @@
<style lang="scss" scoped>
.itemContent {
box-sizing: border-box;
display: flex;
justify-content: flex-start;
height: 100%;
width: 100%;
.thumbnailBox {
width: 300rpx;
box-sizing: border-box;
flex-basis: 300rpx;
margin-right: 26rpx;
align-items: center;
width: 200rpx;
flex: 0 0 auto;
image {
max-width: 100%;
width: 100%;
height: auto;
}
}
.courseDetailBox {
width: 100%;
flex: 1;
color: #333;
height: auto;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.title {
// flex: 1;
display: flex;
max-width: 260rpx;
// justify-content: space-between;
// align-items: center;
// max-width: 260rpx;
// width: 0;
// flex-basis: 100rpx;
font-size: 32rpx;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
.detailBtn {
font-size: 24rpx;
color: #4A4A4A;
......@@ -142,19 +152,32 @@
}
.summaryBox {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
width: 100%;
font-size: 24rpx;
// margin: 10rpx 0;
display: flex;
.text-wrap {
white-space: pre-wrap;
word-break: break-word;
}
text {
margin-right: 20rpx;
}
}
.dataBox {
strong {
display: flex;
flex-direction: row;
align-items: center;
.price {
width:150rpx;
color: #F15A1F;
font-size: 30rpx;
margin: 10rpx 20rpx 10rpx 0;
font-weight: 600;
}
text {
......
<template>
<view class="search">
<input class="searchInput" type="text" name="" id="" v-model="queryName" @confirm="searchBtn()"/>
<!-- <input
class="searchInput"
type="text"
name=""
id=""
v-model="queryName"
@confirm="searchBtn()"
/> -->
<input
class="searchInput"
type="text"
name=""
id=""
v-model="localQuery"
@confirm="searchBtn()"
@input="handleInput"
/>
<text class="iconfont icon-sousuo" @click="searchBtn()"></text>
<text class="iconfont icon-xiaoxi"></text>
<text class="system_msg" @click="jumpToSystemMsg()">{{messageUnreadCount}}</text>
......@@ -11,19 +27,33 @@
import api from "../../api/api";
import common from '../../common/common';
export default{
props:['isSearch','userId'],
props:['isSearch','userId', 'initialQuery'],
data(){
return {
messageUnreadCount:null,
queryName:null
queryName:null,
localQuery: this.initialQuery || '',
}
},
name:'search',
components:{},
onLoad(options){
this.queryName = options.queryName;
watch: {
initialQuery: {
immediate: true, // 立即触发
handler(newVal) {
this.localQuery = newVal || ''; // 处理 null/undefined
}
}
},
methods:{
// 新增方法:允许父组件重置搜索词
resetSearch() {
this.localQuery = '';
},
handleInput(e) {
this.localQuery = e.detail.value;
},
jumpToSystemMsg(){
if(this.userId){
uni.navigateTo({
......@@ -50,16 +80,31 @@
searchBtn(){
if(this.isSearch == 1){
//掉查询
this.$emit("send",this.queryName)
}else{
//有参数就掉查询否则直接跳转到课程列表页
if(this.queryName){
uni.setStorageSync('queryName',this.queryName)
}
// this.$emit("send",this.queryName)
this.$emit("send", this.localQuery);
}else {
this.$emit("update:initialQuery", this.localQuery); // 新增
uni.setStorageSync('queryName', this.localQuery);
uni.switchTab({
url:'/pages/courselist/courselist'
})
}
url: '/pages/courselist/courselist'
});
}
// else{
// //有参数就掉查询否则直接跳转到课程列表页
// if(this.queryName){
// uni.setStorageSync('queryName', this.localQuery);
// // uni.setStorageSync('queryName',this.queryName)
// }
// uni.switchTab({
// url:'/pages/courselist/courselist'
// })
// }
}
},
mounted() {
......
......@@ -35,7 +35,7 @@ const config = {
stage,
prod
}
let env = 'dev';
let env = 'prod';
let baseURL = config[env].base_url;
let apiURL = config[env].api_url;
......
......@@ -115,7 +115,7 @@
</view>
<view class="contentItem">
<text>居住地址</text>
<view><input type="text" class="form-control" placeholder="请选择" v-model="applyParam.liveAddress"
<view><input type="text" class="form-control" placeholder="请输入" v-model="applyParam.liveAddress"
:disabled="this.applyParam.approvalStatus!= 0 && this.applyParam.approvalStatus != 2" />
</view>
</view>
......
......@@ -45,7 +45,7 @@
<!-- 课程详情图 -->
<view class="courseTitleContent">
<view class="courseTitle">
<view class="" style="width: 70%;">
<view class="" style="width: 100%;">
<h4>{{courseInfo.fileTitle}}</h4>
</view>
<view class="shareF">
......@@ -577,6 +577,11 @@
} else {
this.isRenderVideo = true;
}
// #ifdef H5
const shareCode = nanoid() + this.userId
const jumptime = Date.parse(new Date()) / 1000
this.getshareData2(shareCode, jumptime,0)
// #endif
}
})
},
......@@ -779,14 +784,17 @@
}
})
},
getshareData2(shareCode,jumptime) {
getshareData2(shareCode,jumptime,type=1) {
let newLink = type==1?shareURL + "/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode + '&shareUserId=' +
this.userId + '&jumpUrl=' + jumptime + "&"
: shareURL + "/pages/courseDetail/courseDetail?fileId=" + this.fileId
console.log('this.courseInfo',this.courseInfo);
let data = {
title: this.courseInfo.fileTitle,
// desc: '加入我们开启学习之旅',
desc:this.courseInfo.fileSynopsis,
link: shareURL + "/pages/courseDetail/courseDetail?fileId=" + this.fileId +
'&coursesharing=1' + '&serialsNo=' + nanoid() + '&shareCode=' + shareCode + '&shareUserId=' +
this.userId + '&jumpUrl=' + jumptime + "&", //分享链接
link: newLink, //分享链接
imgUrl: this.courseInfo.displayImage, //图片
}
//安卓机型获取当前页面路径
......@@ -802,8 +810,12 @@
}
}
// let url = window.location.href.split('#')[0]
hshare(data, url)
this.submitsuessc(shareCode,jumptime)
if(type==1){
this.submitsuessc(shareCode,jumptime)
}
},
// H5 自定义分享
getshareData() {
......@@ -933,6 +945,7 @@
if(!this.realName){
this.queryInfo();
}
// this.switchTab(1);
},
onShow() {
......@@ -943,6 +956,7 @@
this.tabType = 1;
this.courseDetail();
uni.setStorageSync('entryUrl',window.location.href.split('#')[0])
},
mounted() {
let _this = this;
......@@ -995,6 +1009,12 @@
</script>
<style lang="scss" scoped>
.container{
width: 100%;
height: auto;
box-sizing: border-box;
// padding: 20rpx;
}
page {
padding: 0;
}
......@@ -1043,7 +1063,9 @@
}
.courseTitleContent {
height: 150rpx;
box-sizing: border-box;
width: 100%;
height: auto;
background-color: #fff;
margin-bottom: 10rpx;
padding: 20rpx 0rpx 20rpx 30rpx;
......@@ -1053,7 +1075,7 @@
display: flex;
justify-content: space-between;
margin-bottom: 16rpx;
box-sizing: border-box;
h4 {
font-size: 40rpx;
}
......
<template>
<view class="pad">
<!--搜索组件-->
<search :isSearch="1" :userId = "userId" @send="getCourseList"></search>
<search
:isSearch="1"
:userId = "userId"
@send="getCourseList"
:initialQuery="queryName"
></search>
<!--轮播组件-->
<view class="banner">
<view class="uni-margin-wrap">
......@@ -50,9 +55,14 @@
carousel,
search
},
onLoad(){
this.queryName = uni.getStorageSync('queryName');
},
onLoad() {
this.queryName = uni.getStorageSync('queryName') || '';
},
onShow() {
this.queryName = uni.getStorageSync('queryName') || '';
this.courseList();
},
methods:{
goDetail(item){
uni.navigateTo({
......@@ -60,6 +70,7 @@
});
},
courseList(){
const param = {
queryName:this.queryName
}
......@@ -77,6 +88,7 @@
}
},
getCourseList(res){
console.log('res',res);
this.queryName = res;
this.courseList()
},
......@@ -104,7 +116,12 @@
}
this.courseList();
},
onTabItemTap() {
// 通过tabbar切换时清空storage
uni.removeStorageSync('queryName');
},
onHide() {
this.queryName = ''
uni.removeStorageSync('queryName')
}
}
......
......@@ -8,10 +8,22 @@
<text class="iconfont icon-31tishi" @click="getIntroduce('center')"></text>
</view>
<!--搜索组件-->
<search :isSearch="0" :userId="userId"></search>
<!-- <search
:isSearch="0"
:userId="userId"
></search> -->
<search
ref="searchRef"
:isSearch="0"
:userId="userId"
:initialQuery.sync="searchQuery"
v-if="showSearch"
></search>
<!--轮播组件-->
<view class="banner">
<view class="uni-margin-wrap">
<carousel :carouselList="cffpUserInfo.fileUploadItemList"></carousel>
</view>
</view>
......@@ -77,7 +89,8 @@
export default {
data() {
return {
showSearch: true,
searchQuery: '',
companyFullName : companyInfo.companyFullName,
cffpCourseInfos: [],
x: 0,
......@@ -160,7 +173,7 @@
shareId: null,
kefu: '../../static/kefu.png',
loginornot: true,
queryName: ''
queryName: '',
}
},
components: {
......@@ -173,8 +186,17 @@
onShow() {
this.init();
this.showSearch = false;
this.$nextTick(() => {
this.showSearch = true;
this.searchQuery = '';
});
},
onLoad() {
onLoad(options) {
if(options.clearFlag){
uni.setStorageSync('loginType', 'visitor');
}
//如果用户在其他的地方快捷登录,没有返回到首页,执行此监听方法
uni.$on('loginUpdate',()=>{
this.queryAreaCenterInfo();
......@@ -185,8 +207,13 @@
this.courseList();
}
},
beforeDestroy() {
// 清除事件监听
uni.$off('loginUpdate', this.queryAreaCenterInfo);
},
methods: {
init() {
if (uni.getStorageSync('isLogin')) {
let loginType = uni.getStorageSync('loginType')
......@@ -471,6 +498,7 @@
.ulBox {
flex-direction: column;
width: 100%;
}
.liBox {
......@@ -478,6 +506,7 @@
border-radius: 20rpx;
margin-bottom: 10rpx;
padding: 10rpx;
width: 100%;
}
.description {
......
......@@ -24,7 +24,8 @@
</view>
<view class="ulBox" v-if="cffpCourseInfos.length>0">
<view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item>
<!-- :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}" -->
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" ></course-item>
</view>
</view>
</view>
......
......@@ -12,8 +12,19 @@
</view> -->
<view class="band">
<view class="contentItem">
<!-- @keydown="handleKeyDown"
@compositionstart="isComposing = true"
@compositionend="handleCompositionEnd"
@input="handleInput" -->
<text>真实名称</text>
<input class="user-input" v-model="optionForm.realName" type="text" placeholder="请输入姓名" />
<input
class="user-input"
v-model="optionForm.realName"
type="text"
placeholder="请输入姓名"
maxlength="20"
/>
</view>
<view class="contentItem">
<text>昵称</text>
......@@ -43,6 +54,9 @@
export default {
data() {
return {
isComposing: false,
// 敏感词列表(可扩展)
bannedWords: ["admin", "test", "root", "password"],
companyType : companyInfo.companyType,
companyLogo : '../../static/myteam/logo.png',
dataForm: {
......@@ -88,6 +102,55 @@
this.optionForm = JSON.parse(options.customerBasicInfo)
},
methods: {
handleKeyDown(e) {
console.log('this.isComposing',this.isComposing);
const key = e.key;
if (this.isComposing || ["Backspace", "Delete", "ArrowLeft", "ArrowRight"].includes(key)) return;
if (!/^[a-zA-Z0-9\u4e00-\u9fa5]$/.test(key)) {
e.preventDefault();
uni.showToast({ title: "请输入汉字", icon: "none" });
}
},
handleInput(e) {
if (this.isComposing) return; // 正在输入拼音,不处理
let value = e.detail.value;
// 1. 过滤特殊字符(仅允许英文、数字、汉字)
value = value.replace(/[^a-zA-Z0-9\u4e00-\u9fa5]/g, "");
// 2. 检查敏感词
const hasBannedWord = this.bannedWords.some(word =>
value.toLowerCase().includes(word.toLowerCase())
);
if (hasBannedWord) {
uni.showToast({
title: "包含敏感词汇,请修改",
icon: "none"
});
value = value.replace(new RegExp(this.bannedWords.join("|"), "gi"), "");
}
// 3. 限制长度(20字符)
if (value.length > 20) {
value = value.slice(0, 20);
uni.showToast({
title: "最多输入20个字符",
icon: "none"
});
}
// 4. 更新数据
this.optionForm.realName = value;
this.$nextTick(() => this.optionForm.realName = value); // iOS 兼容
},
handleCompositionEnd(e) {
this.isComposing = false;
this.handleInput(e); // 拼音输入结束,检查内容
},
goBack() {
let back = getCurrentPages();
if (back && back.length > 1) {
......@@ -111,18 +174,20 @@
return;
}else if (!common.nameValid(this.optionForm.realName)) {
let that = this;
uni.showModal({
content: '真实姓名不合规,是否继续保存',
confirmText: '保存',
cancelText: '取消',
success: function (res) {
if (res.confirm) {
that.saveUserInfo();
}else{
return;
}
}
});
uni.showToast({title: '请填写真实姓名',duration: 2000,icon: 'none'});
this.optionForm.realName = ''
// uni.showModal({
// content: '真实姓名不合规,是否继续保存',
// confirmText: '保存',
// cancelText: '取消',
// success: function (res) {
// if (res.confirm) {
// that.saveUserInfo();
// }else{
// return;
// }
// }
// });
}else{
this.saveUserInfo();
}
......@@ -150,6 +215,11 @@
</script>
<style scoped>
.input-tip {
color: #ff5a5f;
font-size: 12px;
margin-left: 10px;
}
.content {
width: 100vw;
}
......
......@@ -35,6 +35,7 @@ export function initJssdkShare(callback, url) {
}
// data是穿的参数 url是当前页面的链接
export function hshare(data,url){
console.log('data,url',data,url);
// initJssdkShare(data, url)
initJssdkShare(function(){
jWeixin.ready(function(){
......
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