Commit 1cb7f09e authored by 石家欣's avatar 石家欣

sjx

parent 364d6703
......@@ -3,8 +3,8 @@
//"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web
"description" : "",
"versionName" : "1.0.57",
"versionCode" : 157,
"versionName" : "1.0.60",
"versionCode" : 160,
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
......@@ -148,7 +148,7 @@
}
}
},
"compilerVersion" : 3
"compilerVersion" : 2
},
/* 快应用特有相关 */
"quickapp" : {},
......
......@@ -53,7 +53,7 @@
,{
"path" : "pages/edit/shop/shop",
"style" : {
"navigationBarTitleText":"商家信息编辑"
"navigationBarTitleText":"商家信息"
}
}
......
......@@ -41,7 +41,7 @@
<view class="inputitem flex">
<view class="names">发放数量</view>
<input type="number" placeholder="请填写满多少元可以使用" v-model="parameter.count" class="inputs" placeholder-class="plclass">
<input type="number" placeholder="请填写发放的数量" v-model="parameter.count" class="inputs" placeholder-class="plclass">
</view>
</view>
<!-- 第一块结束 -->
......
......@@ -286,7 +286,7 @@
// console.info(this.goodsCate[i].children[j],"111111");
let itemtwo = this.goodsCate[i].children[j];
if(itemtwo.cate_id==this.canform.cate_id){
console.info("111这个才是",itemtwo);
// console.info("111这个才是",itemtwo);
this.datachind=itemone;//二级赋值
this.cate_name = this.goodsCate[i].value;//一级名称
......@@ -375,12 +375,12 @@
},
//富文本处理完毕 事件 获取最后的html 数据 子组件调用的
editOk(e){//2.xxxx
console.info("col",e.html);
// console.info("col",e.html);
//调用完毕 调用 create_goods
let htaltag = e.html
let newStr = htaltag.replace(new RegExp(/\"/g), "");
console.log(newStr);
// console.log(newStr);
this.canform.details = newStr;//e.html
this.create_goods();
......@@ -419,15 +419,16 @@
})
console.info(this.canform,"canform");
// console.info(this.canform,"canform");
// return false;
//添加
if(this.canform.price<this.canform.mall_price){
console.log(this.canform.mall_price)
console.log(this.canform.price)
if(parseFloat(this.canform.price)<parseFloat(this.canform.mall_price)){
this.$api.msg('商城价格不能大于市场价格');
this.issubmit=true;
return;
}
let res = await addEditGoods(this.canform)
......@@ -457,12 +458,12 @@
},
//多选 勾选 列表
checkboxChange(e){
console.log(e);
// console.log(e);
this.selchildList = e.detail.value;
},
// 改变下拉选项 一级的
bindPickerChange (event) {
console.info(event.detail.value);
// console.info(event.detail.value);
this.parent_name = "";
this.canform.cate_id = "";
this.cate_name = this.goodsCate[event.detail.value].value;
......@@ -471,7 +472,7 @@
},
//二级分类选中后处理
bindPickerss (event) {
console.log(event.detail.value);
// console.log(event.detail.value);
this.parent_name = this.datachind[event.detail.value].value;
this.canform.cate_id = this.datachind[event.detail.value].cate_id;//分类id
},
......
......@@ -3,44 +3,48 @@
<view class="shopinfoss">
<view class="logobox">
<image v-if="fromdata.logo!='' && fromdata.logo!=null" @tap="uploadimgs" class="islogimg" :src="staticUrl+fromdata.logo" mode=""></image>
<view class="islogimg" v-else @tap="uploadimgs">上传logo</view>
<image v-if="fromdata.logo!='' && fromdata.logo!=null" class="islogimg" :src="staticUrl+fromdata.logo"
mode=""></image>
<!-- <view class="islogimg" v-else @tap="uploadimgs">上传logo</view> -->
</view>
<view class="biao">
<view class="cu-form-group ">
<view class="title">联系人:</view>
<input class="title" style="flex-grow: 1;" placeholder="请输入联系人" v-model="fromdata.contact"></input>
<input class="title" style="flex-grow: 1;" placeholder="请输入联系人" disabled="disabled" v-model="fromdata.contact"></input>
</view>
<view class="cu-form-group ">
<view class="title">店铺电话:</view>
<input class="title" style="flex-grow: 1;" placeholder="请输入店铺电话" v-model="fromdata.tel"></input>
<input class="title" style="flex-grow: 1;" placeholder="请输入店铺电话" disabled="disabled" v-model="fromdata.tel"></input>
</view>
<view class="cu-form-group ">
<view class="title">店铺地址:</view>
<input class="title" style="flex-grow: 1;" placeholder="请输入店铺地址" v-model="fromdata.addr"></input>
<input class="title" style="flex-grow: 1;" placeholder="请输入店铺地址" disabled="disabled" v-model="fromdata.addr"></input>
</view>
<view class="cu-form-group" @click="biaozu">
<!-- @click="biaozu" -->
<!-- <view class="cu-form-group" >
<view class="title">标注位置:</view>
<input :placeholder="address" name="input" disabled></input>
<text v-if="!address" class='cuIcon-locationfill text-orange'></text>
</view>
</view> -->
<view class="biao_05 cu-form-group">
<view class="cu-form-group flex" style="padding: 30upx;">
<view class="title">营业时间:</view>
<view class="time flex" >
<view class="time flex">
<view class="biao_05_2">
<view class="uni-list-cell-db flex">
<picker mode="time" :value="time" @change="bindTimeChange" style="margin-top: 6px;">
<!-- @change="bindTimeChange" -->
<!-- <picker mode="time" :value="time" style="margin-top: 6px;"> -->
<view class="uni-input">{{time}}</view>
</picker>
<!-- </picker> -->
</view>
</view>
<view class="biao_05_2 flex" style="margin: 10upx 10px 0 0;">--</view>
<view class="biao_05_2 flex" style="margin: 0 0 0 10px;">--</view>
<view class="uni-list-cell-db flex">
<picker mode="time" :value="time_close" @change="bindTimeChange_close" style="margin-top: 6px;">
<!-- @change="bindTimeChange_close" -->
<!-- <picker mode="time" :value="time_close" style="margin-top: 6px;"> -->
<view class="uni-input">{{time_close}}</view>
</picker>
<!-- </picker> -->
</view>
</view>
</view>
......@@ -48,7 +52,9 @@
<view class="title">介绍:</view>
</view>
<view class="cu-form-group">
<textarea maxlength="-1" v-model="fromdata.details" placeholder="请输入介绍"></textarea>
<!-- <textarea maxlength="-1" type="rich-text" v-model="fromdata.details" placeholder="请输入介绍"></textarea> -->
<!-- <editor id="editor" @input="onEditorInput" @ready="onEditorReady(fromdata.details)"></editor> -->
<rich-text contenteditable="false" :nodes="fromdata.details"></rich-text>
<!-- :disabled="modalName!=null" -->
</view>
<!-- <view class="cu-form-group ">
......@@ -61,19 +67,23 @@
</view>
<view class="p_btn">
<!-- <view class="p_btn">
<view class=" flex flex-direction">
<button @tap="addNewStoreFun()" class="cu-btn bg-red margin-tb-sm lg">提交</button>
</view>
</view>
</view> -->
</view>
</template>
<script>
import uniIcon from "@/components/uni-icon/uni-icon.vue"
import wPicker from "@/components/w-picker/w-picker.vue";
import graceRichText from "@/utils/richText.js";
import config from "@/utils/config.js";
import {addNewStore,shopDetail} from "@/utils/api/api.js";
import {
addNewStore,
shopDetail
} from "@/utils/api/api.js";
import QQMapWX from "@/utils/libs/qqmap-wx-jssdk.min.js";
var qqmapsdk = new QQMapWX({
......@@ -85,23 +95,23 @@
data() {
return {
content: [],
list:[],
list: [],
address: '',
time: '09:00',
time_close: '19:00',
modalName:"",//?
switchA:false,
modalName: "", //?
switchA: false,
//提交的表单
fromdata:{
contact :"",//联系人
tel:"",//电话
lat:"",///经纬度
lng:"",//经纬度
details:"",//介绍
addr:"",//地址
business_time:"",//时间
logo:"",//店铺logo
fromdata: {
contact: "", //联系人
tel: "", //电话
lat: "", ///经纬度
lng: "", //经纬度
details: "", //介绍
addr: "", //地址
business_time: "", //时间
logo: "", //店铺logo
// city_code: "",//城市代码
// area_code: "",//区号
......@@ -118,22 +128,21 @@
//可能少的
//address: "",//详细地址
cate_id: 0,//分了id
shop_name: "",//店铺名称
cate_id: 0, //分了id
shop_name: "", //店铺名称
makeruid: "",
city_code: 360100,//城市代码
area_code: 360102,//区号
cate_name: "品牌服装",//分类名称 文字
city_code: 360100, //城市代码
area_code: 360102, //区号
cate_name: "品牌服装", //分类名称 文字
shopinfos:{},
shopinfos: {},
};
},
onLoad() {
this.content=this.$api.json.content;
this.content = this.$api.json.content;
//获取之前设置过的信息
this.getshopDetail();
},
......@@ -142,75 +151,79 @@
wPicker
},
//计算属性
computed:{
staticUrl(){
computed: {
staticUrl() {
return this.$store.state.staticUrl;
},
uploaddata(){
return {model:"shopphoto",user_token:this.$store.state.token,shop_id:this.$store.state.userInfo.shop_id}
uploaddata() {
return {
model: "shopphoto",
user_token: this.$store.state.token,
shop_id: this.$store.state.userInfo.shop_id
}
}
},
methods: {
//获取之前设置过的信息
async getshopDetail(){
async getshopDetail() {
let res = await shopDetail({
});
if(res.code==0){
if (res.code == 0) {
this.shopinfos = res.data;
this.fromdata.contact = this.shopinfos.contact;
this.fromdata.tel = this.shopinfos.tel;
this.fromdata.lat = this.shopinfos.lat;
this.fromdata.lng = this.shopinfos.lng;
this.fromdata.details = this.shopinfos.details;
// this.fromdata.details = this.shopinfos.details;
this.fromdata.details = graceRichText.format(this.shopinfos.details);
this.fromdata.addr = this.shopinfos.addr;
this.fromdata.business_time = this.shopinfos.business_time;//营业时间 需要特殊处理
this.fromdata.business_time = this.shopinfos.business_time; //营业时间 需要特殊处理
this.fromdata.logo = this.shopinfos.logo;
//console.info(this.fromdata.business_time.split("---"),"business_time");
if(this.fromdata.business_time.indexOf("---")!=-1){
if (this.fromdata.business_time.indexOf("---") != -1) {
let timearr = this.fromdata.business_time.split("---");
if(timearr.length!=0){
if (timearr.length != 0) {
this.time = timearr[0];
this.time_close=timearr[1];
this.time_close = timearr[1];
}
}else if(this.fromdata.business_time.indexOf("--")!=-1){
} else if (this.fromdata.business_time.indexOf("--") != -1) {
let timearr = this.fromdata.business_time.split("--");
if(timearr.length!=0){
if (timearr.length != 0) {
this.time = timearr[0];
this.time_close=timearr[1];
this.time_close = timearr[1];
}
}else if(this.fromdata.business_time.indexOf("-")!=-1){
} else if (this.fromdata.business_time.indexOf("-") != -1) {
let timearr = this.fromdata.business_time.split("-");
if(timearr.length!=0){
if (timearr.length != 0) {
this.time = timearr[0];
this.time_close=timearr[1];
this.time_close = timearr[1];
}
}
}else{
} else {
this.$api.msg(res.msg);
}
},
//上传图片方法
uploadimgs(){
uploadimgs() {
uni.chooseImage({
count:1,
count: 1,
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
uni.uploadFile({
url: config.SiteBaseUrl+'FileUpload/uploadify', //仅为示例,非真实的接口地址
url: config.SiteBaseUrl + 'FileUpload/uploadify', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'img',
formData: this.uploaddata,
success: (uploadFileRes) => {
console.log(uploadFileRes.data,"上传成功后~");
console.log(uploadFileRes.data, "上传成功后~");
let resdata = JSON.parse(uploadFileRes.data);
console.info(resdata,"resdata");
console.info(resdata, "resdata");
this.fromdata.logo = resdata.data;
}
......@@ -219,19 +232,21 @@
});
},
//提交修改
async addNewStoreFun(){
async addNewStoreFun() {
this.fromdata.business_time = this.time + "---" + this.time_close;//营业时间
this.fromdata.business_time = this.time + "---" + this.time_close; //营业时间
// console.info(this.fromdata);
// return false;
let objs = {...this.shopinfos,...this.fromdata};
let objs = { ...this.shopinfos,
...this.fromdata
};
let res = await addNewStore(this.fromdata);//this.fromdata
if(res.code==0){
let res = await addNewStore(this.fromdata); //this.fromdata
if (res.code == 0) {
this.$api.msg(res.msg);
}else{
} else {
this.$api.msg(res.msg);
}
......@@ -240,10 +255,10 @@
// this.$api.msg("暂时不允许修改");
// }
},
textareaAInput(e){
textareaAInput(e) {
},
SwitchAchange(e){
SwitchAchange(e) {
},
TimeChange(e) {
......@@ -298,7 +313,7 @@
chooseLocation() {
const that = this
uni.chooseLocation({
success: (res)=> {
success: (res) => {
that.address = res.name
that.list.position = res
......@@ -314,7 +329,7 @@
latitude: res.latitude,
longitude: res.longitude
},
success: (restwo)=>{
success: (restwo) => {
//debugger
//console.log(res)
let province = res.result.ad_info.province;
......@@ -329,7 +344,7 @@
//console.info(restwo);
},
fail: (err)=>{
fail: (err) => {
console.log(err)
}
})
......@@ -337,15 +352,31 @@
}
});
},
onEditorReady(data) {
uni.createSelectorQuery().select('#editor').context((res) => {
console.log(res)
this.editorCtx = res.context;
let content = {
html: data
}
this.editorCtx.setContents(content); //设置富文本编辑器的内容
}).exec()
},
onEditorInput(res){
if(res.detail.html){
this.fromdata.details = res.detail.html
}
}
}
}
</script>
<style lang="scss">
.logobox{
.logobox {
padding: 15upx 0;
text-align: center;
.islogimg{
.islogimg {
width: 200upx;
height: 200upx;
line-height: 200upx;
......
......@@ -4,7 +4,7 @@
<view class="container">
<navigator url="/pages/edit/shop/shop" class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">门店编辑</text>
<text class="cell-tit">门店信息</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</navigator>
<navigator url="/pages/edit/Qualifications/Qualifications" class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
......@@ -37,10 +37,10 @@
<text class="cell-tit">切换门店</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</navigator>
<view class="list-cell b-b" @tap="oneTodeleteStore" hover-class="cell-hover" >
<!-- <view class="list-cell b-b" @tap="oneTodeleteStore" hover-class="cell-hover" >
<text class="cell-tit">关闭店铺</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
</view>
</view> -->
<navigator url="/pages/setPassword/setPassword?is_pay=0" class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
<text class="cell-tit">修改登录密码</text>
<image class="jiantousi" src="/static/news/jiantousi.png" mode=""></image>
......
/*
graceUI rich-text 加强工具
link : graceui.hcoder.net
author : 5213606@qq.com 深海
*/
// 正则变量
var graceRichTextReg;
// 批量替换的样式 [ 根据项目需求自行设置 ]
var GRT = [
// div 样式
['div', "line-height:2em;"],
// h1 样式
['h1', "font-size:3em; line-height:1.5em;"],
// h2 样式
['h2', "font-size:2em; line-height:1.8em;"],
// h3 样式
['h3', "font-size:1.6em; line-height:2em;"],
// h4 样式
['h4', "font-size:1.2em; line-height:2em;"],
// h5 样式
['h5', "font-size:1em; line-height:2em;"],
// h6 样式
['h6', "font-size:0.9em; line-height:2em;"],
// p 样式
['p', "font-size:1em; line-height:2em;"],
// b 样式
['b', "font-size:1em; line-height:2em;"],
// strong 样式
['strong', "font-size:1em; line-height:2em;"],
// code 样式
['code', "font-size:1em; line-height:1.2em; background:#F6F7F8; padding:8px 2%; width:96%;"],
// img 样式
['img', "width:100%; margin:8px 0;"],
// blockquote
['blockquote', "font-size:1em; border-left:3px solid #D1D1D1; line-height:2em; border-radius:5px; background:#F6F7F8; padding:8px 2%;"],
// li 样式
['ul', "padding:5px 0; list-style:none; padding:0; margin:0;"],
['li', "line-height:1.5em; padding:5px 0; list-style:none; padding:0; margin:0; margin-top:10px;"],
// table
['table', "width:100%; border-left:1px solid #F2F3F4; border-top:1px solid #F2F3F4;"],
['th', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4;"],
['td', "border-right:1px solid #F2F3F4; border-bottom:1px solid #F2F3F4; padding-left:5px;"]
];
module.exports = {
format : function(html){
html = html.replace(/<pre.*pre>?/gis, function(word){
word = word.replace(/[\n]/gi,'<br />');
word = word.replace(/ /gi,'<span style="padding-left:2em;"></span>');
return word.replace(/[\t]/gi, '<span style="padding-left:2em;"></span>');
});
html = html.replace(/<pre/gi, '<p style="font-size:1em; margin:12px 0; line-height:1.2em; background:#F6F7F8; border-radius:5px; padding:8px 4%; width:92%;"');
html = html.replace(/<\/pre/gi,"</p");
for(let i = 0; i < GRT.length; i++){
graceRichTextReg = new RegExp('<'+GRT[i][0]+'>|<'+GRT[i][0]+' (.*?)>', 'gi');
html = html.replace(graceRichTextReg , function(word){
// 分析 dom 上是否带有 style=""
if(word.indexOf('style=') != -1){
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)style="(.*?)"(.*?)(/?)>', 'gi');
return word.replace(regIn, '<'+ GRT[i][0] +'$1style="$2 ' + GRT[i][1] +'"$3$4>');
}else{
var regIn = new RegExp('<' + GRT[i][0] + '(.*?)(/?)>', 'gi');
return word.replace(regIn, '<'+ GRT[i][0] +'$1 style="' + GRT[i][1] +'$2">');
}
});
}
return html;
}
}
\ No newline at end of file
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