|
|
@@ -228,7 +228,14 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="base-buttom" :class="{ 'bg-gray': loding }" @click="loding ? '' : confirm()">提交</view>
|
|
|
+ <view class="base-buttom flex">
|
|
|
+ <view class="updata flex flex-center" :class="{ 'bg-gray': loding }" @click="loding ? '' : confirm()">
|
|
|
+ 提交
|
|
|
+ </view>
|
|
|
+ <view class="ylan flex flex-center" @click="look">
|
|
|
+ 预览
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -240,10 +247,14 @@
|
|
|
getUserWorkTypeList,
|
|
|
getUserCardInfo
|
|
|
} from '@/api/model.js';
|
|
|
-
|
|
|
import {
|
|
|
isCardNo
|
|
|
} from '@/utils/rocessor.js';
|
|
|
+ import {
|
|
|
+ getAstro,
|
|
|
+ getShengXiao,
|
|
|
+ IdCard
|
|
|
+ } from '@/utils/twelve.js';
|
|
|
import {
|
|
|
mapState
|
|
|
} from "vuex"
|
|
|
@@ -289,15 +300,18 @@
|
|
|
timeTypeList: [], //时间类型
|
|
|
workTypeList: [], //工作类型
|
|
|
loding: false, //是否载入中
|
|
|
- type: 0, //0为新增,1为修改
|
|
|
- userModelData: {} //保存获取的用户模板
|
|
|
-
|
|
|
+ type: 0, //0为新增,1为修改2为商品页进入注册
|
|
|
+ userModelData: {}, //保存获取的用户模板
|
|
|
+ modelid: '', //保存要预览的模板id
|
|
|
};
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
if (options.type == 1) {
|
|
|
this.type = 1;
|
|
|
await this.getUserCardInfo()
|
|
|
+ } else if (options.type == 2) {
|
|
|
+ this.type = 2
|
|
|
+ this.modelid = options.modelid
|
|
|
}
|
|
|
this.init()
|
|
|
},
|
|
|
@@ -338,16 +352,16 @@
|
|
|
(res) => {
|
|
|
that.typeList = res.data.list
|
|
|
if (that.type == 1) {
|
|
|
- console.log(that.userModelData.service_project_ar,'that.userModelData.service_project');
|
|
|
for (let i = 0; i < that.userModelData.service_project_ar.length; i++) {
|
|
|
for (let a = 0; a < that.typeList.length; a++) {
|
|
|
if (+that.typeList[a].id == +that.userModelData.service_project_ar[i].id) {
|
|
|
that.typeList[a].checked = true;
|
|
|
+ that.updata.checkedType.push(''+that.typeList[a].id)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(res,'服务');
|
|
|
+ console.log(res, '服务');
|
|
|
}
|
|
|
).catch(
|
|
|
(res) => {
|
|
|
@@ -360,10 +374,9 @@
|
|
|
that.workTypeList = res.data.list
|
|
|
if (that.type == 0) {
|
|
|
that.updata.word = that.workTypeList[0];
|
|
|
-
|
|
|
} else if (that.type == 1) {
|
|
|
for (let i = 0; i < that.workTypeList.length; i++) {
|
|
|
- console.log(that.userModelData.user_work_type_id,'word',that.workTypeList[i].id);
|
|
|
+ console.log(that.userModelData.user_work_type_id, 'word', that.workTypeList[i].id);
|
|
|
if (that.workTypeList[i].id == that.userModelData.user_work_type_id) {
|
|
|
that.updata.word = that.workTypeList[i];
|
|
|
break
|
|
|
@@ -377,9 +390,60 @@
|
|
|
}
|
|
|
)
|
|
|
},
|
|
|
+ // 跳转查看预览页面
|
|
|
+ look() {
|
|
|
+ const that = this;
|
|
|
+ const birthday = IdCard('' + that.updata.cardId, 1);
|
|
|
+ // 复制选中的服务数组
|
|
|
+ let arr = [...that.updata.checkedType]
|
|
|
+ let pushar=[];
|
|
|
+ that.typeList.forEach(
|
|
|
+ (re) => {
|
|
|
+ for (let i = 0; i < arr.length; i++) {
|
|
|
+ console.log(arr[i],'循环');
|
|
|
+ if (+arr[i] == +re.id) {
|
|
|
+ // 删除已选中的对象
|
|
|
+ arr.splice(i, 1)
|
|
|
+ pushar.push(re)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+
|
|
|
+ let data = {
|
|
|
+ name: that.updata.name,
|
|
|
+ avatar: that.updata.avatar,
|
|
|
+ age: IdCard(that.updata.cardId, 3),
|
|
|
+ twelve: getShengXiao(birthday),
|
|
|
+ work_year: that.updata.work_year,
|
|
|
+ constellation: getAstro(...(birthday.split('-'))),
|
|
|
+ ancestral_place: that.updata.ancestral_place,
|
|
|
+ minority: that.updata.minority,
|
|
|
+ education: that.updata.education,
|
|
|
+ service_area_all: that.updata.onCity.map(
|
|
|
+ (item) => {
|
|
|
+ return item.province + item.city + item.district
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ service_min_price: that.updata.minMoney,
|
|
|
+ service_max_price: that.updata.maxMoney,
|
|
|
+ service_time_type_title: that.updata.timetype.title,
|
|
|
+ service_intro_content: that.updata.mymask,
|
|
|
+ service_intro_imgs: that.updata.service_imgs,
|
|
|
+ service_audit_imgs: that.updata.service_audit_imgs,
|
|
|
+ service_project_ar: pushar,
|
|
|
+ is_type_audit: 1
|
|
|
+ }
|
|
|
+ uni.setStorageSync('modeldata',data)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/user/model/model?mtype=' + that.user.show_template_id + '&look=2'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取用户提交数据
|
|
|
getUserCardInfo() {
|
|
|
const that = this;
|
|
|
- return new Promise((resolve,reject) => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
getUserCardInfo().then(
|
|
|
(data) => {
|
|
|
const res = data.data;
|
|
|
@@ -405,12 +469,12 @@
|
|
|
ancestral_place: res.ancestral_place, //籍贯
|
|
|
education: res.education, //学历
|
|
|
minority: res.minority, //民族
|
|
|
-
|
|
|
+
|
|
|
work_year: res.work_year, //从业时长
|
|
|
service_audit_imgs: res.service_audit_imgs, //我的证书
|
|
|
service_imgs: res.service_imgs, //服务展示
|
|
|
})
|
|
|
- console.log(that.updata,'that.updata');
|
|
|
+ console.log(that.updata, 'that.updata');
|
|
|
resolve('初始化数据成功')
|
|
|
}
|
|
|
).catch(
|
|
|
@@ -419,7 +483,7 @@
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
// 选中的服务类型
|
|
|
checkTypeChange(type) {
|
|
|
@@ -819,8 +883,24 @@
|
|
|
|
|
|
.base-buttom {
|
|
|
position: fixed;
|
|
|
- bottom: 30rpx;
|
|
|
+ bottom: 0rpx;
|
|
|
right: 0rpx;
|
|
|
left: 0rpx;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+ height: 100rpx;
|
|
|
+ border-radius: 0;
|
|
|
+
|
|
|
+ .updata,
|
|
|
+ .ylan {
|
|
|
+ width: 50%;
|
|
|
+ height: 100%;
|
|
|
+ justify-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .ylan {
|
|
|
+ background-color: #FFF;
|
|
|
+ color: $font-color-dark;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|