Browse Source

add miniapp-change-category

tid1509
赵明涛 9 months ago
parent
commit
badf843f46
  1. 2
      src/manifest.json
  2. 2
      src/pages/login/login.vue
  3. 869
      src/subpackage/party/components/popup-content/miniapp-change-category.vue
  4. 8
      src/subpackage/party/components/popup-content/miniapp-change-name.vue
  5. 2
      src/subpackage/party/components/popup-content/miniapp-change-signature.vue
  6. 2
      src/subpackage/party/pages/index/index.vue
  7. 126
      src/subpackage/party/pages/miniapp/regist.vue

2
src/manifest.json

@ -57,7 +57,7 @@
/* */
"plugins": {
"miniprogram-thirdparty-plugin": {
"version": "0.3.13",
"version": "0.3.12",
"provider": "wxb8b928431b8c56d8",
"export": ""
},

2
src/pages/login/login.vue

@ -49,7 +49,7 @@ const uniGetSetting = util.promisify(uni.getSetting);
const uniLogin = util.promisify(uni.login);
const APPID = uni.getAccountInfoSync().miniProgram.appId;
const MiniprogramThirdpartyPlugin = requirePlugin('miniprogram-thirdparty-plugin')
// const MiniprogramThirdpartyPlugin = requirePlugin('miniprogram-thirdparty-plugin')
export default {
computed: {
isProfile: _=> util.isProfile(),

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

@ -0,0 +1,869 @@
<template>
<!-- 弹窗 -->
<!-- :class="[directionClass,{'b-popup-round':round||''},{'b-popup-animation':animation||''}]" -->
<view class="m-popup b-popup " v-if="true" >
<view class="b-popup-shade" @click="showPopup = false"></view>
<view class="b-popup-content">
<view class="b-content-view b-flex-y b-flex-c">
<!-- 右上角关闭按钮 -->
<view class="b-flex-x b-flex-e b-mb-20 b-flex-as-e">
<text class="b-icon icon-close b-t-gray b-t-44" @click="closeChange"></text>
</view>
<view class="b-t-B b-t-36 b-mb-40">小程序类目设置</view>
<!-- 可修改次数,已修改次数 -->
<!-- <view class="b-flex-x b-mb-20">
<text class="b-t-28 b-t-gray">可修改次数:</text>
<text class="b-t-28 b-t-green">{{appInfo.nickname_info.modify_quota}}</text>
<text class="b-t-28 b-t-gray"></text>
<text class="b-t-28 b-t-gray b-ml-40">已修改次数:</text>
<text class="b-t-28 b-t-red">{{appInfo.nickname_info.modify_used_count}}</text>
<text class="b-t-28 b-t-gray"></text>
</view> -->
<!-- 一键选择类目 -->
<view class="b-flex-x b-flex-as-e b-pr-40 b-mb-40 b-mt-30">
<text class="b-t-28 b-t-gray" @click="fastAddCategory">一键选择体育场馆</text>
</view>
<picker mode="multiSelector"
@change="bindPickerChange_queryCategories"
@columnchange="bindPickerChange_queryCategories_column"
:value="queryCategories_index"
range-key="name"
:range="queryCategories">
<input @click="" class="bc-input b-mb-50" disabled="true" v-model="queryCategories_show" type="text" placeholder="请选择"
placeholder-class="input-hold-class">
</input>
</picker>
<!-- <input @click="" class="bc-input b-mb-50" disabled="true" v-model="userInputName" type="text" placeholder="请选择"
placeholder-class="input-hold-class">
</input> -->
<!-- <text class=" bc-arrow b-icon icon-right b-t-gray b-t-28 b-t-B"></text> -->
<!-- <view class=" b-flex-x b-mt-10 b-mb-60" v-if="!checkNameRes">
<button class="b-btn b-btn-green b-btn-line " @click="closeChange">取消</button>
<button class="b-btn b-btn-green b-ml-40" @click="clickSure">确定</button>
</view> -->
<view class="rb-line" v-if="exterList.length>0"></view>
<view class="rb-text b-t-24 b-t-red b-p-40" v-if="exterList.length>0">
<text >{{exterInfo.scope||""}}</text>
<!-- <text v-else>你申请的名称涉及特定地域范围或地理名称需要经过平台审核后才可使用你可以直接提交审核或提供商标注册证等材料以证明你可使用该地域范围或地理名称作为账号名称否则可能审核不通过</text> -->
</view>
<block v-if="exterList.length>0">
<!-- <view class="rb-radio b-flex-x b-mb-40">
<radio-group @change="selectChange">
<radio value="id_card" checked style="transform:scale(0.9)" color="#009876">个人号</radio>
<radio value="license" style="transform:scale(0.9);margin-left: 40rpx;" color="#009876">组织号</radio>
</radio-group>
</view> -->
<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 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)">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"
:src="e.url?e.url:imgbg"
></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
</view>
<!-- <view v-if="true" class="b-flex-y b-flex-c rb-line b-mt-10" @click="clickUploadImg('license')">
<view class="b-mb-30 b-t-26">营业执照</view>
<view class="rb-upload-item b-flex-y b-flex-c">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
</view>
<view v-if="true" class="b-flex-y b-flex-c b-mt-10" @click="clickUploadImg('naming_other_stuff_1')">
<view class="b-mb-30 b-t-26">关键词补充材料</view>
<view class="rb-upload-item b-flex-y b-flex-c">
<image class="rb-upload-bg" src="../../static/regist/upload_bg.png"></image>
<image class="rb-upload-cam" src="../../static/regist/camera.png"></image>
<text class="rb-input-img-text">点击上传</text>
</view>
</view> -->
<!-- <view class="b-flex-as-e b-ml-40 b-t-24 b-t-green b-t-B b-t-U">重新上传</view> -->
</view>
</scroll-view>
</block>
<view class="rb-btns b-flex-x b-mt-40 b-mb-50">
<button class="b-btn b-btn-green b-mr-40" @click="closeChange">取消</button>
<button class="b-btn b-btn-green " @click="clickSure">确定</button>
</view>
</view>
</view>
</view>
</template>
<script>
import util from '@/utils/util';
import { servers } from '@/js/server';
import party_api from '../../js/api.js';
import { mapState } from 'vuex';
export default {
props: {
appInfo: {
type: Object,
default: ()=>({
// showPopup:true,
})
},
appid: {
type: String,
default: ''
},
queryInfo: {
type: Object,
default: ()=>({
})
},
},
computed: {
...mapState(['brandInfo']),
},
created(){
console.log("类目 oncreated ")
this.setData()
},
data() {
return {
showPopup:true,
userInputName: '',//
checkNameRes: "",//
selectType:"",//
localImg :{
id_card: {
mediaid: '',
url: '',
txt:"身份证照片"
},
license: {
mediaid: '',
url: '',
txt:"组织机构代码证或营业执照"
},
naming_other_stuff_1: {
mediaid: '',
url: '',
txt:"关键词补充材料"
}
},
imgbg:"../../static/regist/upload_bg.png",
queryCategories: [[],[]],//
queryCategories_child: [],//
queryCategories_index:[[0],[0]],//index
queryCategories_show:"请选择",
queryCategories_sport_index:null,
exterList: [],//
// exterList: [{"name":"/","url":"","mediaid":"","url_origin":""},{"name":"/","url":"","mediaid":"","url_origin":"https://res.wx.qq.com/op_res/BPlSPJtUqcBCopjAOauMB9U_taQRxlbmQ7WTCG44uvOVMs6vXPEM8Zy9XyhU-Jn3aO2szARomffYSfMCO-I64Q"}],//
exterInfo:{
scope:""
},
}
},
methods: {
moveHandle(){},
closeChange(){
this.$emit('close');
},
async setData(){
util.showLoad()
try {
await this.getcategory()
await this.getAllCategoriesByType()
} catch (error) {
console.log("setData-err", error)
}
util.hideLoad()
},
clickCheckName(){
if(this.userInputName == '')return util.showNone('请输入名称!');
this.checkwxverifynickname();
},
async addcategory(arr){
let media_res = await this.getMediaidFromList()
console.log("addcategory:",media_res)
if(!media_res){
return
}
let _data = this.getGateWayJson("addcategory")
let _add_cacategorie = [{
certicates:media_res,
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()
}
})
},
getMediaidFromList(){
let arr = []
let {exterList} = this
//exterList
if(exterList.length == 0){
return []
}
for (var key in exterList) {
if(exterList[key].mediaid){
arr.push({
key:exterList[key].name,
value:exterList[key].mediaid,
// expire_time,
// is_permanent
})
}
}
if(exterList.length != arr.length){
util.showNone("请上传所有附件")
console.log("需要对比:",exterList,arr)
return false
}
console.log(arr)
return arr
},
async clickSure(){
// let temp = this.getMediaidFromList()
// console.log("clickSure:",temp)
let msg = "注意: 最多可以设置的类目数量: 5 个;是否添加?"
let msg_res = await util.showModalMsg(msg,true)
if(msg_res){
//type
let select_type = []
let value = this.queryCategories_index
select_type.push(this.queryCategories[0][value[0]].id)
select_type.push(this.queryCategories[1][value[1]].id)
this.addcategory(select_type)
console.log('select_type:', select_type)
this.$emit('sure',this.appInfo);
}else{
util.showNone("取消添加")
this.$emit('close');
}
},
async fastAddCategory(){
let msg_res = await util.showModalMsg("一键添加:体育场馆服务类目?",true)
console.log("fastAddCategory:",msg_res)
if(msg_res){
// this.addcategory([674, 676])
this.queryCategories[1] = this.queryCategories_child[0] //. :
this.bindPickerChange_queryCategories({target:{value:[0,0]}})
}else{
util.showNone("取消添加")
}
},
bindPickerChange_queryCategories(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
let value = e.target.value;
let data = ""
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
data = this.queryCategories[1][this.queryCategories_index[1]]
}
console.log("bindPickerChange_queryCategories 111:",data)
//, . ,
if (data.sensitive_type === 1) {
data.qualify.exterList = [];
data.qualify.exter_list.forEach((item) => {
item.inner_list.forEach((item2) => {
item2.mediaid = "";//, mediaid
item2.url_origin = item2.url;//url
item2.url = "";//
data.qualify.exterList.push(item2);
});
});
console.log("类目命中敏感词:",data.qualify.scope,data.qualify.exterList)
this.exterList = data.qualify.exterList
console.log(JSON.stringify(data.qualify.exterList))
}else{
this.exterList = []
}
this.exterInfo = data
console.log("bindPickerChange_queryCategories 222:",data)
//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)
// 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
}
},
copyUrl(url){
uni.setClipboardData({
data: url,
success: function () {
util.showNone('复制成功')
}
});
},
async clickUploadImg(e,i){
//for (e,i) in exterList
let {exterList} = this
exterList[i].url = await this.getLocalImg();
console.log("clickUploadImg-local:", exterList[i].url)
exterList[i].mediaid = await this.getUploadImgMediaId(exterList[i].url);
console.log("clickUploadImg-mediaid:", exterList[i].mediaid)
//,
// this.localImg[which].url = await this.getUploadImgURL(this.localImg[which].url);
},
resetLocalImg(){
this.localImg = {
id_card: {
mediaid: '',
url: '',
txt:"身份证照片"
},
license: {
mediaid: '',
url: '',
txt:"组织机构代码证或营业执照"
},
naming_other_stuff_1: {
mediaid: '',
url: '',
txt:"关键词补充材料"
}
}
},
getUploadImgURL(tempFilePath){
return servers.uploadFile({
url: party_api.webUpload,
filePath: tempFilePath,
name: 'file',
formData: {}
})
.then(res=>{
console.log("uploadFile-res", res)
if(res.statusCode == 200){
// console.log("uploadFile-url 1", res.data.data.url)
let _data = JSON.parse(JSON.stringify(res.data))
console.log("uploadFile-url return type", typeof(_data))
// console.log("uploadFile-url ", JSON.parse(_data))
_data = JSON.parse(_data).data
return _data.url
}
})
.catch(err=>{
console.log("uploadFile-err", err)
})
},
//
getLocalImg() {
console.log("clickUploadImg");
return new Promise((resolve, reject) => {
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: (res) => {
console.log("chooseImage", res)
let tempFilePaths = res.tempFilePaths[0];
resolve(tempFilePaths)
},
fail: (err) => {
console.log("chooseImage-err", err)
reject(err)
}
});
})
},
getUploadImgMediaId(tempFilePath){
let appid = this.appid
let _param_str = `module=/cgi-bin/media/upload&appid=${appid}`
let _url = party_api.gatewayDoDuplicate+"?"+_param_str
return servers.uploadFile({
url: _url,
filePath: tempFilePath,
name: 'image',
formData: {
'form.type':"image"
}
})
.then(res=>{
console.log("uploadFile-gatewayDoDuplicate-res", res)
if(res.statusCode == 200){
let _data = JSON.parse(JSON.stringify(res.data))
console.log("uploadFile-url return type", typeof(_data))
_data = JSON.parse(_data).data
console.log("uploadFile-gatewayDoDuplicate-上传成功 接口真正数据", _data)
return _data.media_id
}
})
.catch(err=>{
console.log("uploadFile-err", err)
})
},
getUploadImgURL(tempFilePath){
return servers.uploadFile({
url: party_api.webUpload,
filePath: tempFilePath,
name: 'file',
formData: {}
})
.then(res=>{
console.log("uploadFile-res", res)
if(res.statusCode == 200){
// console.log("uploadFile-url 1", res.data.data.url)
let _data = JSON.parse(JSON.stringify(res.data))
console.log("uploadFile-url return type", typeof(_data))
// console.log("uploadFile-url ", JSON.parse(_data))
_data = JSON.parse(_data).data
return _data.url
}
})
.catch(err=>{
console.log("uploadFile-err", err)
})
},
setnickname(){
let _data = this.getGateWayJson('setnickname')
_data.form.nick_name = this.userInputName
_data.form.id_card = this.localImg.id_card.mediaid
_data.form.license = this.localImg.license.mediaid
console.log("setnickname:",_data)
return servers.post({
url: party_api.gatewayDo,
data: _data,
isDefaultGet: false,
})
.then(res=>{
console.log("setnickname:", res.data)
if(res.data.code!=0){
util.showNone("设置失败")
console.log("setnickname-err", res.data)
}else{
util.showNone('设置成功')
}
})
.catch(err=>{
console.log("setnickname-err", err)
})
},
checkwxverifynickname(){
this.checkNameRes = {}
let _data = this.getGateWayJson('checkwxverifynickname')
_data.form.nick_name = this.userInputName
console.log("getaccountbasicinfo:",_data)
servers.post({
url: party_api.gatewayDo,
data: _data,
isDefaultGet: false,
})
.then(res=>{
console.log("checkwxverifynickname:", res.data)
if(res.data.code!=0){
util.showNone("名称不可用")
console.log("checkwxverifynickname-err", res.data)
}else{
util.showNone('名称可用')
if(!res.data.data.hit_condition){
res.data.message = '名称可用(注意:改名次数将在自然年 1 月 1 日和微信认证审核通过后重置为 2 次.请慎重修改.)'
}
}
this.checkNameRes = res.data
console.log("checkwxverifynickname123123:", this.checkNameRes)
})
.catch(err=>{
console.log("checkwxverifynickname-err", err)
})
},
gatewayDo(postJson) {
// postJson.token = "2187a643-4d4a-11ee-a364-5254005df464"
let url = party_api.gatewayDo
// #ifdef H5
url+= "?token=" + "2187a643-4d4a-11ee-a364-5254005df464"
// #endif
if(this.appid) postJson.appid = this.appid
return servers.post({
url: url,
data: postJson,
isDefaultGet: false,
})
.then(res => {
console.log("gatewayDo 0 :", res.data)
if(res.data.code!=0){
return util.showNone(res.data.message)
}else{
return res.data
}
})
.catch(err => {
console.log("gatewayDo-err", err)
})
},
getGateWayJson(jname){
let appid = this.appid
let _data = party_api["gatewayDoJson"][jname]
if(!appid){
console.error("当前page中: this.appid不存在")
return util.showNone("appid不存在")
}
if(!_data){
console.error("先去api.js定义透传数据:",jname)
return util.showNone("接口不存在")
}
_data.appid = appid;
return _data
},
confirmChange(){
let { brandInfo, orderInfo, input_amount, selectType } = this
if(input_amount == '')return util.showNone('请输入金额!');
util.showLoad();
deviceServer.get({
url: deviceApi.timeOrderEnd,
data: {
brand_id: brandInfo.brand.id,
order_no: orderInfo.order_no,
pay_amount: parseFloat(input_amount),
end_type: selectType==1?'end_timing':selectType==2?'end_order':'',
},
failMsg: '加载失败!'
})
.then(res=>{
util.hideLoad()
util.showNone('操作成功!');
this.$emit('close');
// setTimeout(()=>uni.navigateBack(),1200);
this.$emit('timeEndBtn');
})
},
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,false)//
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 = false) {
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)
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",
"module":"/cgi-bin/wxopen/getcategory",
"method":"GET",
"form":{}
}
data.appid = this.appid
return servers.post({
url: party_api.gatewayDo,
data: data,
isDefaultGet: false,
})
.then(res=>{
console.log("getcategory:", res.data)
if(res.data.code!=0){
return util.showNone("errcode:"+res.data.errcode+"-"+res.data.errmsg)
}else{
this.categoryInfo = res.data.data
return res.data
}
})
.catch(err=>{
console.log("getcategory-err", err)
})
},
selectBtn(type){
this.selectType = type
},
selectChange(e){
console.log(e.detail)
this.selectType = e.detail.value
},
},
}
</script>
<style lang="scss" >
@import '~style/public.scss';
@import '../../ui/maincss.scss';
.scroll-Y{
height: 300rpx;
}
.m-popup{
.b-popup-shade{
background: rgba(0,0,0,0.5);
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
}
.b-popup-content{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
background: #fff;
border-radius: 5rpx;
z-index: 101;
.b-content-view{
width: 620rpx;
padding: 20rpx;
.b-content-title{
}
.bc-input{
width: 538rpx;
height: 88rpx;
background: #FFFFFF;
border: 2rpx solid #D8D8D8;
border-radius: 10rpx;
padding-left: 30rpx;
}
.bc-arrow{
position: relative;
right: 40rpx;
padding-top: 58rpx;
}
.input-hold-class{
font-size: 28rpx;
}
.rb-line{
border-bottom: 1rpx solid #E5E5E5;
width: 100%;
}
.rb-btns{
>button{
width: 240rpx;
height: 88rpx;
}
>button:first-child{
background: #fff;
color: $b-color-green;
// border: 1rpx solid $b-color-green;
}
}
.rb-text{
>text{
line-height: 40rpx;
}
border-bottom: 1rpx solid #E5E5E5;
}
.rb-upload-list{
width: 100%;
.rb-upload-item{
width: 168rpx;
height: 168rpx;
// position: relative;
.rb-upload-bg{
width: 168rpx;
height: 168rpx;
position: absolute;
}
.rb-upload-cam{
width: 48rpx;
height: 40rpx;
z-index: 2;
}
.rb-input-img-text{
font-size: 24rpx;
margin-top: 24rpx;
color: #1A1A1A;
z-index: 2;
}
}
.idcard-width-170{
width: 280rpx;
height: 170rpx;
.rb-upload-bg{
width: 280rpx;
height: 170rpx;
position: absolute;
}
}
}
}
}
.popup-demo{
font-size: 32rpx;
color: #333333;
}
}
</style>

8
src/subpackage/party/components/popup-content/miniapp-change-name.vue

@ -32,8 +32,8 @@
<view class="rb-line"></view>
<view class="rb-text b-t-24 b-t-red b-p-40">
<text >{{checkNameRes.message||checkNameRes.data.wording}}</text>
<view class="rb-text b-t-24 b-t-red b-p-40" v-if="checkNameRes">
<text >{{checkNameRes.message||checkNameRes.data.wording||""}}</text>
<!-- <text v-else>你申请的名称涉及特定地域范围或地理名称需要经过平台审核后才可使用你可以直接提交审核或提供商标注册证等材料以证明你可使用该地域范围或地理名称作为账号名称否则可能审核不通过</text> -->
</view>
@ -114,7 +114,9 @@ export default {
return {
showPopup:true,
userInputName: '',//
checkNameRes: "",//
checkNameRes: {
data: {},
},//
selectType:"",//
localImg :{

2
src/subpackage/party/components/popup-content/miniapp-change-jian-jie.vue → src/subpackage/party/components/popup-content/miniapp-change-signature.vue

@ -31,7 +31,7 @@
<view class="rb-line"></view>
<view class="rb-text b-t-24 b-t-red b-p-40">
<view class="rb-text b-t-24 b-t-red b-p-40" v-if="checkNameRes">
<text >{{checkNameRes.message||checkNameRes.data.wording}}</text>
<!-- <text v-else>你申请的名称涉及特定地域范围或地理名称需要经过平台审核后才可使用你可以直接提交审核或提供商标注册证等材料以证明你可使用该地域范围或地理名称作为账号名称否则可能审核不通过</text> -->
</view>

2
src/subpackage/party/pages/index/index.vue

@ -140,7 +140,7 @@
this.checkMiniAppRegist()
},
computed: {
...mapState(['brandInfo', ]),
// ...mapState(['brandInfo', ]),
getManagerUrl(){
return this.url_manager[this.getUrlIndex()];
},

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

@ -83,16 +83,17 @@
</view>
<view class="rb-add-view b-mr-40">
<picker mode="multiSelector"
<!-- <input class="rb-input" style="width:300rpx" disabled="true" v-model="queryIcpServiceContentTypes_show" type="text" placeholder="请选择"
placeholder-class="input-hold-class"></input> -->
<button class="b-btn b-btn-green b-btn-sm " @click="clickSet(3)">添加</button>
<!-- <picker mode="multiSelector"
@change="bindPickerChange_queryCategories"
@columnchange="bindPickerChange_queryCategories_column"
:value="queryCategories_index"
range-key="name"
:range="queryCategories">
<button class="b-btn b-btn-green b-btn-sm " @click="clickSet(3)">添加</button>
<!-- <input class="rb-input" style="width:300rpx" disabled="true" v-model="queryIcpServiceContentTypes_show" type="text" placeholder="请选择"
placeholder-class="input-hold-class"></input> -->
</picker>
</picker> -->
</view>
<!-- <button class="b-btn b-btn-green b-btn-sm b-mr-40" @click="clickSet(3)">设置</button> -->
@ -200,17 +201,23 @@
</view>
</view> -->
<miniappChangeName v-if="showChangeNameModule"
<app-change-name v-if="showChangeNameModule"
:appInfo="appInfo" :appid="appid"
@sure="nameChange"
@close="showChangeNameModule = false"
></miniappChangeName>
></app-change-name>
<app-change-signature v-if="showChangeSignatureModule"
:appInfo="appInfo" :appid="appid"
@sure="signatureChange"
@close="showChangeSignatureModule = false"
></app-change-signature>
<miniappChangeJianJie v-if="showChangeJianJieModule"
<app-change-category v-if="showChangeCategoryModule"
:appInfo="appInfo" :appid="appid"
@sure="jianjieChange"
@close="showChangeJianJieModule = false"
></miniappChangeJianJie>
@sure="categoryChange"
@close="showChangeCategoryModule = false"
></app-change-category>
</view>
</template>
@ -221,7 +228,8 @@ import { servers } from '@/js/server';
import party_api from '../../../party/js/api';
import miniappChangeName from '../../components/popup-content/miniapp-change-name.vue';
import miniappChangeJianJie from '../../components/popup-content/miniapp-change-jian-jie.vue';
import miniappChangeSignature from '../../components/popup-content/miniapp-change-signature.vue';
import miniappChangeCategory from '../../components/popup-content/miniapp-change-category.vue';
import {
mapState
@ -229,20 +237,21 @@ import {
export default {
components: {
"miniapp-change-name": miniappChangeName,
"miniapp-change-jian-jie": miniappChangeJianJie,
"app-change-name": miniappChangeName,
"app-change-signature": miniappChangeSignature,
"app-change-category": miniappChangeCategory,
},
data() {
return {
showChangeCategoryModule:false,
showChangeNameModule:false,
showChangeJianJieModule:false,
showChangeSignatureModule:false, //showChangeSignatureModule showChangeJianJieModule
brandInfo:"",
appid: "",//appid
showPopup:false,
directionClass:"",
round:false,
animation:true,
animation:false,
appInfo:{
"account_type": 3,
"appid": "",
@ -324,6 +333,7 @@ export default {
queryCategories_child: [],//
queryCategories_index:[[0],[0]],//index
queryCategories_show:"请选择",
queryCategories_sport_index:null,
@ -404,7 +414,7 @@ export default {
bindPickerChange_queryCategories(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
let value = e.target.value;
this.queryIcpServiceContentTypes_index = value;
this.queryCategories_index = value;
if (this.queryCategories[0].length != 0) {
this.queryCategories_show = this.queryCategories[0][this.queryCategories_index[0]].name
};
@ -436,15 +446,21 @@ export default {
// 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] = this.queryCategories_child[e.detail.value]
this.queryCategories[1] = children_arr
// #endif
// #ifdef MP-WEIXIN
// H5 $set
this.$set(this.queryCategories, 1, this.queryCategories_child[e.detail.value])
this.$set(this.queryCategories, 1, children_arr)
// #endif
}
},
@ -468,14 +484,12 @@ export default {
console.log("clickSet",value)
//value: 1() 2() 3()
if(value == 1) this.showChangeNameModule = true;
if(value == 2) this.showChangeJianJieModule = true;
// this.showChangeNameModule = true;
// this.showChangeNameModule = true;
if(value == 2) this.showChangeSignatureModule = true;
if(value == 3) this.showChangeCategoryModule = true;
},
async getAllCategoriesByType() {
try {
const res = await this.gatewayDo({
// appid: row.mini_wechat_appid,
appid: this.appid,
module: '/cgi-bin/wxopen/getcategoriesbytype',
method: 'POST',
@ -485,25 +499,21 @@ export default {
});
console.log("getAllCategoriesByType:", res.data.errcode,res)
if (res.data.errcode === 0) {
let allCategories = ""
let categories = res.data.categories_list.categories
// console.log("11111",res.data.categories_list.categories)
/*
getTwoArrFromWX(res,needSportFirst,needSportOnly)
:
res,true,true:只需要体育类目
res,false,true:只需要体育类目
res,true,false:将体育类目放在第一个
res,false,false:使用默认数据,可选所有类目
*/
let obj = this.getTwoArrFromWX(res,true,true)//
let obj = this.getTwoArrFromWX(res)
console.log("obj:",obj)
this.queryCategories = obj.array_obj;
this.queryCategories_child = obj.child_arr;
/**/
// console.log(res.data.categories_list.categories);
/**
id number 类目 ID
name bufffer 类目名称
level number 类目层级
father number 类目父级 ID
children array<number> 子级类目 ID
sensitive_type number 是否为敏感类目1 为敏感类目需要提供相应资质审核0 为非敏感类目无需审核
qualify
*/
this.queryCategories_sport_index = obj.index_sport;
} else {
util.showNone(res.data.errmsg);
}
@ -512,7 +522,12 @@ export default {
} catch (error) {
}
},
getTwoArrFromWX(res) {
getTwoArrFromWX(res,needSportFirst=false,needSportOnly = true) {
if(needSportOnly){//
needSportFirst = true
}
let categories = res.data.categories_list.categories
let firstLevel = []
@ -550,14 +565,39 @@ export default {
})
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;
@ -712,10 +752,14 @@ export default {
nameChange(e){
console.log("nameChange",e)
},
jianjieChange(e){
signatureChange(e){
console.log("jianjieChange",e)
this.setJianJie(e)
this.showChangeJianJieModule = false
this.showChangeSignatureModule = false
},
categoryChange(e){
console.log("categoryChange",e)
this.showChangeCategoryModule = false
},
async clickUploadImg(place,where,which){
let {localImg} = this

Loading…
Cancel
Save