Browse Source

pre clean

tid1509
赵明涛 9 months ago
parent
commit
ca5b348585
  1. 2
      src/subpackage/party/components/popup-content/miniapp-change-category.vue
  2. 416
      src/subpackage/party/pages/miniapp/regist.vue

2
src/subpackage/party/components/popup-content/miniapp-change-category.vue

@ -65,7 +65,7 @@
<scroll-view scroll-y="true" class="scroll-Y" @scroll="" scroll-left="0">
<view class="rb-upload-list b-flex-y b-flex-c">
<!-- rb-line -->
<view v-if="true" v-for="(e,i) in exterList" class="b-flex-y b-flex-c b-mt-10 b-pb-40" >
<view v-if="true" v-for="(e,i) in exterList" :key="i" class="b-flex-y b-flex-c b-mt-10 b-pb-40" >
<view class="b-mb-20 b-t-24 b-t-B">{{i+1}}/{{exterList.length}} - {{e.name}}</view>
<view class="b-mb-20 b-t-24 b-t-green" @click="copyUrl(e.url_origin)" v-if="e.url_origin">复制参考链接</view>
<view class="rb-upload-item b-flex-y b-flex-c" @click="clickUploadImg(e,i)">

416
src/subpackage/party/pages/miniapp/regist.vue

@ -243,9 +243,9 @@ export default {
},
data() {
return {
showChangeCategoryModule:false,
showChangeNameModule:false,
showChangeSignatureModule:false, //showChangeSignatureModule showChangeJianJieModule
showChangeCategoryModule:false, //
showChangeNameModule:false, //
showChangeSignatureModule:false, //
brandInfo:"",
appid: "",//appid
showPopup:false,
@ -329,11 +329,11 @@ export default {
}],
},
queryCategories: [[],[]],//
queryCategories_child: [],//
queryCategories_index:[[0],[0]],//index
queryCategories_show:"请选择",
queryCategories_sport_index:null,
// queryCategories: [[],[]],//
// queryCategories_child: [],//
// queryCategories_index:[[0],[0]],//index
// queryCategories_show:"",
// queryCategories_sport_index:null,
@ -351,7 +351,7 @@ export default {
this.getWebBrandUser() //-
this.get_icp_entrance_info()//
this.getcategory()
this.getAllCategoriesByType()
// this.getAllCategoriesByType()
},
onShow() {
@ -393,93 +393,93 @@ export default {
// },
},
methods: {
addcategory(arr){
let _data = this.getGateWayJson("addcategory")
let _add_cacategorie = [{
certicates:[],
first:arr[0],
second:arr[1],
}]
_data.form.categories = _add_cacategorie
// data.appid = this.appid
this.gatewayDo(_data).then(res => {
console.log("addcategory:",res)
if(res.code == 0){
util.showNone("添加成功")
this.getcategory()
}
})
},
bindPickerChange_queryCategories(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
let value = e.target.value;
this.queryCategories_index = value;
if (this.queryCategories[0].length != 0) {
this.queryCategories_show = this.queryCategories[0][this.queryCategories_index[0]].name
};
if (this.queryCategories[1].length != 0) {
this.queryCategories_show += '/' + this.queryCategories[1][this.queryCategories_index[1]].name
}
//type
let select_type = []
select_type.push(this.queryCategories[0][value[0]].id)
select_type.push(this.queryCategories[1][value[1]].id)
console.log('select_type:', select_type)
let that = this
let msg = "注意: 最多可以设置的类目数量: 5 个;是否添加?"
uni.showModal({
title: '提示',
content: msg,
showCancel: true,
confirmText: '添加',
confirmColor: '#009874',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
that.addcategory(select_type);
}
}
});
// this.form.icp_applets.base_info.service_content_types = select_type
},
bindPickerChange_queryCategories_column(e){
console.log(e.detail)
//
if (e.detail.column == 0) {
let children_arr = this.queryCategories_child[e.detail.value]
if(this.queryCategories_sport_index>=0){
this.queryCategories[1] = this.queryCategories_child[e.detail.value]
}
console.log("children_arr:",children_arr,e.detail.value)
// #ifdef H5
// H5
this.queryCategories[1] = children_arr
// #endif
// #ifdef MP-WEIXIN
// H5 $set
this.$set(this.queryCategories, 1, children_arr)
// #endif
}
},
bindPickerChange_queryCategories1(e){
console.log('picker发送选择改变,携带值为', e.detail.value)
this.queryCategories_index = e.detail.value
this.queryCategories_show = this.queryCategories[0][e.detail.value[0]].name + "/" + this.queryCategories[1][e.detail.value[1]].name
},
bindPickerChange_queryCategories_column1(e){
console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
let data = {
"column": e.detail.column,
"value": e.detail.value,
"queryCategories": this.queryCategories,
"queryCategories_child": this.queryCategories_child,
"queryCategories_index": this.queryCategories_index,
}
this.queryCategories = this.changeQueryCategories(data)
},
// addcategory(arr){
// let _data = this.getGateWayJson("addcategory")
// let _add_cacategorie = [{
// certicates:[],
// first:arr[0],
// second:arr[1],
// }]
// _data.form.categories = _add_cacategorie
// // data.appid = this.appid
// this.gatewayDo(_data).then(res => {
// console.log("addcategory:",res)
// if(res.code == 0){
// util.showNone("")
// this.getcategory()
// }
// })
// },
// bindPickerChange_queryCategories(e) {
// console.log('picker', e.target.value)
// let value = e.target.value;
// this.queryCategories_index = value;
// if (this.queryCategories[0].length != 0) {
// this.queryCategories_show = this.queryCategories[0][this.queryCategories_index[0]].name
// };
// if (this.queryCategories[1].length != 0) {
// this.queryCategories_show += '/' + this.queryCategories[1][this.queryCategories_index[1]].name
// }
// //type
// let select_type = []
// select_type.push(this.queryCategories[0][value[0]].id)
// select_type.push(this.queryCategories[1][value[1]].id)
// console.log('select_type:', select_type)
// let that = this
// let msg = ": : 5 ;?"
// uni.showModal({
// title: '',
// content: msg,
// showCancel: true,
// confirmText: '',
// confirmColor: '#009874',
// success: function (res) {
// if (res.confirm) {
// console.log('');
// that.addcategory(select_type);
// }
// }
// });
// // this.form.icp_applets.base_info.service_content_types = select_type
// },
// bindPickerChange_queryCategories_column(e){
// console.log(e.detail)
// //
// if (e.detail.column == 0) {
// let children_arr = this.queryCategories_child[e.detail.value]
// if(this.queryCategories_sport_index>=0){
// this.queryCategories[1] = this.queryCategories_child[e.detail.value]
// }
// console.log("children_arr:",children_arr,e.detail.value)
// // #ifdef H5
// // H5
// this.queryCategories[1] = children_arr
// // #endif
// // #ifdef MP-WEIXIN
// // H5 $set
// this.$set(this.queryCategories, 1, children_arr)
// // #endif
// }
// },
// bindPickerChange_queryCategories1(e){
// console.log('picker', e.detail.value)
// this.queryCategories_index = e.detail.value
// this.queryCategories_show = this.queryCategories[0][e.detail.value[0]].name + "/" + this.queryCategories[1][e.detail.value[1]].name
// },
// bindPickerChange_queryCategories_column1(e){
// console.log('', e.detail.column, '', e.detail.value);
// let data = {
// "column": e.detail.column,
// "value": e.detail.value,
// "queryCategories": this.queryCategories,
// "queryCategories_child": this.queryCategories_child,
// "queryCategories_index": this.queryCategories_index,
// }
// this.queryCategories = this.changeQueryCategories(data)
// },
clickSet(value){
console.log("clickSet",value)
//value: 1() 2() 3()
@ -487,121 +487,121 @@ export default {
if(value == 2) this.showChangeSignatureModule = true;
if(value == 3) this.showChangeCategoryModule = true;
},
async getAllCategoriesByType() {
try {
const res = await this.gatewayDo({
appid: this.appid,
module: '/cgi-bin/wxopen/getcategoriesbytype',
method: 'POST',
form: {
verify_type: 1
}
});
console.log("getAllCategoriesByType:", res.data.errcode,res)
if (res.data.errcode === 0) {
/*
getTwoArrFromWX(res,needSportFirst,needSportOnly)
:
res,true,true:只需要体育类
res,false,true:只需要体育类
res,true,false:将体育类目放在第一
res,false,false:使用默认数据,可选所有类
*/
let obj = this.getTwoArrFromWX(res,true,true)//
console.log("obj:",obj)
this.queryCategories = obj.array_obj;
this.queryCategories_child = obj.child_arr;
this.queryCategories_sport_index = obj.index_sport;
} else {
util.showNone(res.data.errmsg);
}
// getAllCategoriesByType
} catch (error) {
}
},
getTwoArrFromWX(res,needSportFirst=false,needSportOnly = true) {
if(needSportOnly){//
needSportFirst = true
}
let categories = res.data.categories_list.categories
let firstLevel = []
firstLevel = categories.filter((item) => item.level === 1).map((item) => {
return {
...item,
sub_list: categories.filter(
(item2) => item2.father === item.id
)
};
});
//uni: [[],[]]
let array = [[],[]]
let array_type = [[],[]]
let array_obj = [[],[]] //type,name
let child_arr = []
firstLevel.forEach((item) => {
// array[0].push(item.name)
// array_type[0].push(item.type)
array_obj[0].push(item)
// let children_name = item.children.map((item1) => {
// return item1.name
// })
// array[1].push(children_name)
// let children_type = item.children.map((item1) => {
// return item1.type
// })
// array_type[1].push(children_type)
// async getAllCategoriesByType() {
// try {
// const res = await this.gatewayDo({
// appid: this.appid,
// module: '/cgi-bin/wxopen/getcategoriesbytype',
// method: 'POST',
// form: {
// verify_type: 1
// }
// });
// console.log("getAllCategoriesByType:", res.data.errcode,res)
// if (res.data.errcode === 0) {
// /*
// getTwoArrFromWX(res,needSportFirst,needSportOnly)
// :
// res,true,true:
// res,false,true:
// res,true,false:
// res,false,false:使,
// */
// let obj = this.getTwoArrFromWX(res,true,true)//
// console.log("obj:",obj)
// this.queryCategories = obj.array_obj;
// this.queryCategories_child = obj.child_arr;
// this.queryCategories_sport_index = obj.index_sport;
// } else {
// util.showNone(res.data.errmsg);
// }
// // getAllCategoriesByType
// } catch (error) {
// }
// },
// getTwoArrFromWX(res,needSportFirst=false,needSportOnly = true) {
// if(needSportOnly){//
// needSportFirst = true
// }
// let categories = res.data.categories_list.categories
// let firstLevel = []
// firstLevel = categories.filter((item) => item.level === 1).map((item) => {
// return {
// ...item,
// sub_list: categories.filter(
// (item2) => item2.father === item.id
// )
// };
// });
// //uni: [[],[]]
// let array = [[],[]]
// let array_type = [[],[]]
// let array_obj = [[],[]] //type,name
// let child_arr = []
// firstLevel.forEach((item) => {
// // array[0].push(item.name)
// // array_type[0].push(item.type)
// array_obj[0].push(item)
// // let children_name = item.children.map((item1) => {
// // return item1.name
// // })
// // array[1].push(children_name)
// // let children_type = item.children.map((item1) => {
// // return item1.type
// // })
// // array_type[1].push(children_type)
})
child_arr = firstLevel.map((item) => item.sub_list)// push childArr
let _index_sport="";
if(needSportFirst){ //
//array_obj[0]id=674
_index_sport = array_obj[0].findIndex((item)=>item.id==674)
console.log("_index_sport:",_index_sport)
if(_index_sport>0){
let _temp = array_obj[0][_index_sport]
array_obj[0].splice(_index_sport,1)
array_obj[0].unshift(_temp)
// })
// child_arr = firstLevel.map((item) => item.sub_list)// push childArr
// let _index_sport="";
// if(needSportFirst){ //
// //array_obj[0]id=674
// _index_sport = array_obj[0].findIndex((item)=>item.id==674)
// console.log("_index_sport:",_index_sport)
// if(_index_sport>0){
// let _temp = array_obj[0][_index_sport]
// array_obj[0].splice(_index_sport,1)
// array_obj[0].unshift(_temp)
let _temp_child = child_arr[_index_sport]
child_arr.splice(_index_sport,1)
child_arr.unshift(_temp_child)
}
}
// if(!needSportFirst)
array_obj[1].push(...child_arr[0]) ////
if(needSportOnly){//
array_obj[0].splice(1,array_obj[0].length-1)
}
return {
firstLevel, //picker: [{name,type,children:[]},...]
// array, //uni picker: [[name],[name]]
// array_type,//uni picker type: [[type],[type]]
array_obj,//uni picker obj: [[obj],[obj]]
child_arr,//
index_sport:_index_sport,//
}
// this.queryIcpServiceContentTypes = firstLevel;
// let _temp_child = child_arr[_index_sport]
// child_arr.splice(_index_sport,1)
// child_arr.unshift(_temp_child)
// }
// }
// // if(!needSportFirst)
// array_obj[1].push(...child_arr[0]) ////
// if(needSportOnly){//
// array_obj[0].splice(1,array_obj[0].length-1)
// }
// return {
// firstLevel, //picker: [{name,type,children:[]},...]
// // array, //uni picker: [[name],[name]]
// // array_type,//uni picker type: [[type],[type]]
// array_obj,//uni picker obj: [[obj],[obj]]
// child_arr,//
// index_sport:_index_sport,//
// }
// // this.queryIcpServiceContentTypes = firstLevel;
},
// },
getcategory(){
let data = {
"appid":"wxeb7efb9a1cbdd554",

Loading…
Cancel
Save