图片处理

master
lion 3 months ago
parent 32053108f7
commit fc9c22e27f

@ -4,11 +4,10 @@ export const appConfig = {
// baseUrl: 'http://yunyubang.localhost.com',
baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦
// baseUrl: 'https://yybtest.ali251.langye.net',
// baseUrl: 'http://yunyubang-test.ali251.langye.net',
newBaseUrl: 'https://yunyubang.ali251.langye.net',
// newBaseUrl: 'http://yybtest.ali251.langye.net',
//baseUrl:'https://yybtest2021.langye.net',//孕育咨询
// newBaseUrl: 'http://yunyubang-test.ali251.langye.net',
openidInfoKey: 'openid_info_yunyubang'
}

@ -4,10 +4,10 @@
<image class="banner" :src="info.poster"></image>
</view>
<view class="toptitle">
<view class="h3">{{info.name}}</view>
<view class='price'>
<text class="font_red" v-if="info.price > 0">{{info.price}}</text>
<text class="free" v-else></text>
<view class="h3">{{info.name}}</view>
<view class='price'>
<text class="font_red" v-if="info.price > 0">{{info.price}}</text>
<text class="free" v-else></text>
</view>
<view class="dataGroup">
<view class="dataCol">
@ -38,7 +38,7 @@
<view class="add_l">暂无</view>
<view class="add_r" @click="">
<text class="iconfont icon-dianhua"></text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
</text>
</view>
</view>
@ -52,10 +52,10 @@
<view class="date-txt" v-if="false"> 09:00-18:00</view>
<view class="add_r starts" @click="">
<text class="iconfont icon-dianhua"></text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
</text>
</view>
<view class="txt">{{info.merchant.address}}</view>
</view>
<view class="txt">{{info.merchant.address}}</view>
</view>
</view>
@ -119,17 +119,17 @@
<text class="iconfont icon-Icon_customerservice"></text>
<text>客服</text>
</button>
</view>
<block v-if="info.can_buy===1">
<view class="buyBtn" v-if="info.state=='active'" @click="toBuy">{{buyName}}</view>
<view class="buyBtn buyNoBtn" v-else>{{buyName}}</view>
</view>
<block v-if="info.can_buy===1">
<view class="buyBtn" v-if="info.state=='active'" @click="toBuy">{{buyName}}</view>
<view class="buyBtn buyNoBtn" v-else>{{buyName}}</view>
</block>
</view>
<u-popup v-model="showPop" mode="bottom" closeable="true">
<view class="buyBox">
<view class="title">请输入您的联系方式</view>
<scroll-view scroll-y="true" style="height: 700rpx;padding-bottom: 40rpx;">
<scroll-view scroll-y="true" style="height: 700rpx;padding-bottom: 40rpx;">
<view class="formCol">
<view>宝妈姓名<text style="color:red">*</text></view>
@ -146,25 +146,25 @@
<view class="uni-input">{{form.due_date}}</view>
</picker>
</view>
</view>
<view class="formCol" v-if="modelList.length>1">
<view>产品型号<text style="color:red">*</text></view>
<view class="formRight">
<picker :value="mindex" @change="bindModelChange" :range="modelList">
<view class="uni-input">{{modelList[mindex]}}</view>
</picker>
</view>
</view>
<view class="formCol" v-if="modelList.length>1">
<view>产品型号<text style="color:red">*</text></view>
<view class="formRight">
<picker :value="mindex" @change="bindModelChange" :range="modelList">
<view class="uni-input">{{modelList[mindex]}}</view>
</picker>
</view>
</view>
<view class="formCol">
<view>所属区域<text style="color:red">*</text></view>
<view class="formRight">
<picker :value="rindex" @change="bindRegionChange" :range="arrRegion">
<view class="uni-input">{{arrRegion[rindex]}}</view>
</picker>
<view style="display: flex;align-items: center;">
<text v-if="info.product_type.name==='实物' && rindex!=0" style="color:red">*</text>
<input type="text" :required="info.product_type.name==='实物'?true:false" v-if="rindex!=0" v-model="form.address" style="margin-top: 10rpx;"
placeholder="请输入具体街道/地址">
</picker>
<view style="display: flex;align-items: center;">
<text v-if="info.product_type.name==='实物' && rindex!=0" style="color:red">*</text>
<input type="text" :required="info.product_type.name==='实物'?true:false" v-if="rindex!=0" v-model="form.address" style="margin-top: 10rpx;"
placeholder="请输入具体街道/地址">
</view>
</view>
</view>
@ -259,11 +259,11 @@
id: "",
tel: "18550406975",
showPass: false,
info: {},
info: {},
viewCounts:'',
dataList: [],
buyName:'',
mindex:0,
dataList: [],
buyName:'',
mindex:0,
modelList:['请选择产品型号'],
form: {
product_type: "product",
@ -272,7 +272,7 @@
phone: '',
member_name: "",
member_comment: "",
promotion: "",
promotion: "",
model_name:'',
region: '',
address: '',
@ -333,7 +333,7 @@
that.form.member_name = info.user_info.wechat_nickname;
}
that.loadInfo();
that.loadPage();
that.loadPage();
that.getHospital()
that.getArea()
@ -364,47 +364,58 @@
},
methods: {
//
jumpToWeChatCustomerService() {
this.openWeChatCustomerService("https://work.weixin.qq.com/kfid/kfccc6609d51a87324d?enc_scene=ENC5n1b6XBY2paqReUMjwNmTGay8jwTZQuyn17jL8n5xK9T7ZwfJx36T5EHqVbFWTzP8s", "wwe480a61872b54394");
},
//
openWeChatCustomerService (
weiXinCustomerServiceUrl = "",
corpId = "",
showMessageCard = false,
sendMessageTitle = "",
sendMessagePath = "",
sendMessageImg = ""
) {
if (!weiXinCustomerServiceUrl || !corpId)
return Toast("请配置好客服链接或者企业ID");
// eslint-disable-next-line no-undef
wx.openCustomerServiceChat({
//
extInfo: {
url: weiXinCustomerServiceUrl, // https://work.weixin.qq.com/xxxxxxxx
},
corpId, // ID wwed1ca4d3597eXXXX
showMessageCard, //
sendMessageTitle, //
sendMessagePath, // .htmlpages/index/index.html
sendMessageImg, //
success(res) {
console.log("success", JSON.stringify(res));
},
fail(err) {
console.log("fail", JSON.stringify(err));
// eslint-disable-next-line no-undef
return wx.showToast({
title: err.errMsg,
icon: "none"
});
},
});
methods: {
//
processContentImages: function(content) {
if (!content || typeof content !== 'string') {
return content;
}
// ../storage/files/
content = content.replace(/(["'=:])(\.\.\/storage\/files\/)([^"'\s<>]+)/g, `$1${this.baseUrl}/storage/files/$3`);
// /storage/files/
content = content.replace(/(["'=:])(\/storage\/files\/)([^"'\s<>]+)/g, `$1${this.baseUrl}/storage/files/$3`);
return content;
},
//
jumpToWeChatCustomerService() {
this.openWeChatCustomerService("https://work.weixin.qq.com/kfid/kfccc6609d51a87324d?enc_scene=ENC5n1b6XBY2paqReUMjwNmTGay8jwTZQuyn17jL8n5xK9T7ZwfJx36T5EHqVbFWTzP8s", "wwe480a61872b54394");
},
//
openWeChatCustomerService (
weiXinCustomerServiceUrl = "",
corpId = "",
showMessageCard = false,
sendMessageTitle = "",
sendMessagePath = "",
sendMessageImg = ""
) {
if (!weiXinCustomerServiceUrl || !corpId)
return Toast("请配置好客服链接或者企业ID");
// eslint-disable-next-line no-undef
wx.openCustomerServiceChat({
//
extInfo: {
url: weiXinCustomerServiceUrl, // https://work.weixin.qq.com/xxxxxxxx
},
corpId, // ID wwed1ca4d3597eXXXX
showMessageCard, //
sendMessageTitle, //
sendMessagePath, // .htmlpages/index/index.html
sendMessageImg, //
success(res) {
console.log("success", JSON.stringify(res));
},
fail(err) {
console.log("fail", JSON.stringify(err));
// eslint-disable-next-line no-undef
return wx.showToast({
title: err.errMsg,
icon: "none"
});
},
});
},
calltel(phone) {
const res = uni.getSystemInfoSync();
@ -512,7 +523,7 @@
})
})
}
},
},
bindModelChange:function(e) {
this.mindex = e.target.value;
this.form.model_name = this.modelList[e.target.value];
@ -526,42 +537,42 @@
if (this.arrHospital[e.target.value] != '其他') {
this.form.hospital = this.arrHospital[e.target.value];
}
},
async getArea(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'area'
},
utilSuccess: (res) => {
this.arrRegion = []
this.arrRegion.push("请选择区域")
res.detail.map(item => {
this.arrRegion.push(item.value)
})
}
})
},
async getHospital(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'hospital'
},
utilSuccess: (res) => {
this.arrHospital = []
this.arrHospital.push("请选择建卡医院")
res.detail.map(item => {
this.arrHospital.push(item.value)
})
}
})
async getArea(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'area'
},
utilSuccess: (res) => {
this.arrRegion = []
this.arrRegion.push("请选择区域")
res.detail.map(item => {
this.arrRegion.push(item.value)
})
}
})
},
async getHospital(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'hospital'
},
utilSuccess: (res) => {
this.arrHospital = []
this.arrHospital.push("请选择建卡医院")
res.detail.map(item => {
this.arrHospital.push(item.value)
})
}
})
},
getPoster: function() {
var that = this;
@ -601,7 +612,7 @@
this.$refs.shareCode.open();
this.getPoster();
},
draw: function() {
draw: function() {
var that = this;
uni.request({
@ -814,23 +825,23 @@
return false;
}
if (this.modelList.length>1 && (this.form.model_name == "请选择产品型号" || weixin.isNull(this.form.model_name))) {
this.alert('请选择产品型号')
return
if (this.modelList.length>1 && (this.form.model_name == "请选择产品型号" || weixin.isNull(this.form.model_name))) {
this.alert('请选择产品型号')
return
}
if (this.form.region == "请选择区域" || weixin.isNull(this.form.region)) {
this.alert('请选择区域')
return
}
if(this.info.product_type.name==='实物' && weixin.isNull(this.form.address)){
this.alert('请填写具体地址')
return
}
if(this.info.product_type.name==='实物' && weixin.isNull(this.form.address)){
this.alert('请填写具体地址')
return
}
if (this.form.hospital == "请选择建卡医院") {
this.alert('请选择建卡医院')
return
}
// console.log(this.form)
// console.log(this.form)
// return
// jsuni.$u.throttle()
uni.$u.throttle(this.toDoBuy, 1000);
@ -923,8 +934,8 @@
url: "../shopDetail/shopDetail?id=" + id
})
},
loadInfo: function() {
this.loadView();
loadInfo: function() {
this.loadView();
let that = this
weixin.request({
api: '/api/member/get-product/' + this.id,
@ -933,15 +944,20 @@
//r.data.poster = this.baseUrl + r.data.poster;
that.info = r.data;
that.info.poster = (weixin.isNull(that.info.poster) ? "../../static/750x500.jpg" :
that.info.poster_url)
that.buyName = that.info.state=='active'?'立即购买':'已下架'
let _marr = r.data.model?JSON.parse(r.data.model):[]
if(_marr.length>0){
_marr.map(item=>{
that.modelList.push(item.name)
})
that.info.poster_url)
that.buyName = that.info.state=='active'?'立即购买':'已下架'
//
if (that.info.content) {
that.info.content = that.processContentImages(that.info.content);
}
let _marr = r.data.model?JSON.parse(r.data.model):[]
if(_marr.length>0){
_marr.map(item=>{
that.modelList.push(item.name)
})
}
},
utilFail: r => {
@ -957,8 +973,8 @@
customLoading: false,
data: {
page: 1,
page_size: 3,
sort_name:'sortnumber',
page_size: 3,
sort_name:'sortnumber',
sort_type:"ASC"
},
utilSuccess: function(r) {
@ -979,35 +995,35 @@
util.alert(res);
}
});
},
loadView: function() {
var that = this;
weixin.request({
bindThis: that,
api: '/api/member/other/pv-count',
customLoading: false,
data: {
url:'/api/member/get-product/' + that.id
},
utilSuccess: function(r) {
console.log("r",r)
that.viewCounts = r.total
},
utilFail: function(res) {
util.alert(res);
}
});
},
loadView: function() {
var that = this;
weixin.request({
bindThis: that,
api: '/api/member/other/pv-count',
customLoading: false,
data: {
url:'/api/member/get-product/' + that.id
},
utilSuccess: function(r) {
console.log("r",r)
that.viewCounts = r.total
},
utilFail: function(res) {
util.alert(res);
}
});
}
}
}
</script>
</script>
<style scoped>
/deep/ .parseHtml video {
width: 80% !important;
min-height: 150px !important;
margin: 20px auto;
height:auto!important;
margin: 20px auto;
height:auto!important;
display: block;
}
</style>
@ -1134,9 +1150,9 @@
text-align: center;
line-height: 72rpx;
color: #fff;
}
.buyNoBtn{
background: linear-gradient(90deg, #ddd 0%, #ddd 100%);
}
.buyNoBtn{
background: linear-gradient(90deg, #ddd 0%, #ddd 100%);
}
}
@ -1221,7 +1237,7 @@
.banner {
display: block;
width: 100%;
width: 100%;
height: 535rpx;
// height: 500rpx;
}
@ -1314,7 +1330,7 @@
.discuss {
display: flex;
justify-content: flex-start;
margin: 25rpx 0;
margin: 25rpx 0;
margin-bottom:0;
position: relative;
align-items: center;
@ -1355,7 +1371,7 @@
display: inline-block;
font-size: 36rpx;
font-weight: 500;
color: #333333;
color: #333333;
width:90%;
}
@ -1547,8 +1563,8 @@
margin-left: 24rpx;
display: inline-block;
vertical-align: top;
view{
margin-bottom:10rpx
view{
margin-bottom:10rpx
}
.name {
font-size: 32rpx;
@ -1568,7 +1584,7 @@
display: inline-block;
margin-right: 7rpx;
height: 100%;
line-height: 20rpx;
line-height: 20rpx;
vertical-align: middle;
}
}
@ -1631,14 +1647,14 @@
font-size: 28rpx;
color: #333333;
line-height: 45rpx;
}
}
}
image {
width: 100%;
margin-top: 30rpx;
}
}
}
@ -1900,4 +1916,4 @@
color: #666;
}
}
</style>
</style>

Loading…
Cancel
Save