Merge branch 'cyl/master'

cyl/master-0804
jscyl_mac 5 months ago
commit 7f28c8f253

@ -1,5 +1,6 @@
let bindInfo = {
bind_getCode:"/assistant/circle/agency/apply/inviteCode",// 获取邀请码
bind_getOrderCode:"/yishoudan/user/apply/order/orderDetailsQrCodeImage",// 获取邀请码
bind_getSubscribeDetail :"/assistant/circle/agency/search/code",// 根据搜索code获取对应关注详情
bind_subscribeSubmit:"/assistant/circle/agency/apply/subscribe",// 提交关注
bind_recordList:"/assistant/circle/agency/apply/list",// 申请记录

@ -157,7 +157,7 @@
<view class="g_h_10 g_bg_f_5"></view>
<!-- 跟进记录 -->
<view class="m-reord">
<view class="g_bg_f" style="padding-bottom: 10px; margin-bottom: 60px; padding-top: 32rpx">
<view class="g_bg_f" style="padding-bottom: 10px; margin-bottom: 0px; padding-top: 32rpx">
<view class="g_flex_row_between" style="padding-top: 0; padding-bottom: 0; padding-right: 32rpx; position: relative; margin-left: 20px; margin-bottom: 36rpx">
<view class="g_fs_16 g_c_3 g_flex_column_center">跟进记录</view>
<view @click="handleOpenRemarkModal">
@ -353,25 +353,34 @@
</u-popup>
<view class="g_h_104" style="background-color: #ededed;"></view>
<g-panel-fixed style="box-shadow: 0 -4px 12px #ededed;">
<slot>
<view class="g_pl_20 g_pr_20 g_flex_row_center flex_center flex_nw" style="width: 100%">
<view class="g_flex_1 g_flex_column_center">
<view class="">
<button open-type="share"
class="g_flex_c"
style="background-color: #00b666;color: #fff;width: 250px;height: 42px;font-size: 18px;border-radius: 60px;"
>分享</button>
</view>
</view>
<g-panel-fixed style="box-shadow: 0 -4px 12px #ededed;">
<slot>
<view class="g_pl_20 g_pr_20 g_flex_row_center flex_center flex_nw" style="width: 100%">
<view class="g_flex_1 g_flex_column_center">
<view class="">
<button
@click="createImage"
class="g_flex_c"
style="background-color: #00b666;color: #fff;width: 250px;height: 42px;font-size: 18px;border-radius: 60px;"
>分享</button>
</view>
</slot>
</g-panel-fixed>
</view>
</view>
</slot>
</g-panel-fixed>
<u-popup v-model="shareModal.isShow" mode="bottom" border-radius="16" height='600px' :mask-close-able="true">
<mainPanel :showBg="true" :rid='relationId' :oid='oid' :active="1" :name='orderDetail.userName' :job="orderDetail.storeJobName" :recommendList="recommendList[0]" />
</u-popup>
</view>
</template>
<script>
import mainPanel from "./myMain.vue";
export default {
components:{
mainPanel
},
onReady() {
this.G.setNavStyle();
},
@ -380,6 +389,10 @@ export default {
},
data() {
return {
recommendList:[],
shareModal:{
isShow:false,
},
cdnBaseImg: this.G.store().cdnBaseImg,
agencyId: uni.getStorageSync("apply-agencyId"),
isCreator: false, //
@ -461,20 +474,68 @@ export default {
};
},
onLoad(options) {
this.oid = options.id;
this.relationId = options.relationId;
this.type = options.type;
console.log('工单详情页:',options)
if (options.scene) {
let _str = decodeURIComponent(options.scene);
console.log('邀请 codeRes 1',_str)
let codeRes = _str.split("=");
console.log('邀请 codeRes 2',codeRes)
this.oid = codeRes[1].split('_')[1];
this.relationId = codeRes[1].split('_')[2];
uni.setStorageSync('order_oid',this.oid)
uni.setStorageSync('order_relationId',this.relationId)
this.type = '1';
console.log('邀请 codeRes 3 oid:',this.oid,' rid:',this.relationId)
} else {
if(options.id){
this.oid = options.id;
this.relationId = options.relationId;
this.type = options.type;
}else if(uni.getStorageSync('order_oid')){
this.oid = uni.getStorageSync('order_oid');
this.relationId = uni.getStorageSync('order_relationId');
this.type = options.type;
}
}
},
onShow() {
let that = this;
this.isCreator = uni.getStorageSync("IS_CREATOR") == 1 ? true : false;
this.getResident();
this.getPeople();
this.getDetail();
that.G.Get(
that.api.bind_enterpriseDetail + "/" + uni.getStorageSync("apply-agencyId"),
{
agencyId: uni.getStorageSync("apply-agencyId"),
type: 1,
},
(res) => {
console.log("recommendList", res);
that.recommendList = [res];
console.log("--", that.recommendList);
}
);
uni.$on("infoUpdate", () => {
this.getDetail();
});
},
methods: {
setShareImg(e) {
console.log(e);
this.shareImg = e;
},
getCode(e) {
console.log("获取返回数据:", e);
this.wxCode = e.code;
this.agencyName = e.agencyName;
},
createImage(){
let that = this;
that.shareModal.isShow = true;
},
handleClickLabelBtn($data) {
var that = this;
var text = "";
@ -547,6 +608,8 @@ export default {
relationId: that.relationId,
},
(res) => {
uni.removeStorageSync('order_oid')
uni.removeStorageSync('order_relationId')
console.log("工单详情:", res);
// return;
console.log("res", res);

@ -0,0 +1,330 @@
<template>
<view class="p-root-bind-my-main g_w_all g_h_all g_bg_f_5 g_kuaishou"
:class="showBg ? 'g_pt_32' : ''"
>
<image :src="shareJobImg" show-menu-by-longpress style="width: 343px; height: 555px; margin: 0 auto; display: block" mode=""></image>
<view class="g_text_c g_fs_16 g_mt_12 g_fw_600" style="background-color: #ededed;">长按图片转发给微信好友</view>
<view v-if="allowClick">
<view class="g_h_100" style="background-color: #ededed;"></view>
<g-panel-fixed>
<slot>
<view class="g_flex_row_center">
<g-button btnText="保存图片" size="small" type="default" @clickBtn="saveWXImageToAlbum"></g-button>
<g-button btnText="直接转发" class="g_ml_16" size="small" openType="share" type="primary"></g-button>
</view>
</slot>
</g-panel-fixed>
</view>
<canvas type="2d" style="position: absolute; left: -2000px; width: 425px; height: 350px; " id="canvasId" ref="canvasId"></canvas>
</view>
</template>
<script>
export default {
onReady() {
this.G.setNavStyle();
},
onShareAppMessage() {
return this.G.shareFun();
},
data() {
return {
localBaseImg: this.G.store().localBaseImg,
cdnBaseImg: this.G.store().cdnBaseImg,
wxCode: "",
appCodeSize: 0,
appLogoSize: 0,
appCodeTop: 0,
appLogoTop: 0,
appLogoLeft: 0,
agencyName: "",
shareJobImg: "",
allowClick: false,
appInfo: {},
appfile: null,
canvasWidth: 0,
canvasHeight: 0,
_name:'',
_job:'',
_oid:'',
_rid:''
};
},
props: {
showBg: {
type: Boolean,
default: () => {
return true;
},
},
active: {
default: 0,
},
recommendList: {
type: Object,
default: () => {
return {
logo: "",
jobNum: 0,
jobUpdateNum: 0,
recruitmentJobNum: 0,
downNum: 0,
};
},
},
name:{
default:'',
},
job:{
default:'',
},
oid:{
default:'',
},
rid:{
default:''
}
},
created() {
let that = this;
uni.getImageInfo({
src: "https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/canvasBg.png", //
success(res) {
that.canvasWidth = res.width;
that.canvasHeight = res.height;
},
});
this.init();
// uni.showLoading({
// title: "...",
// });
},
watch: {
shareJobImg(newValue, oldValue) {
if (newValue) {
uni.hideLoading();
}
},
recommendList(val) {
let that = this;
console.log("watch:", val);
// uni.showLoading({
// title: "...",
// });
that.appInfo = val;
this.init();
},
name(val){
this._name = val;
},
job(val){
this._job = val;
},
oid(val){
this._oid = val;
},
rid(val){
this._rid = val;
}
},
methods: {
init() {
let that = this;
that._name = that.name;
that._job = that.job;
that._oid = that.oid;
that._rid = that.rid;
that.appInfo = that.recommendList;
console.log("that.appInfo", that.appInfo);
let _env = uni.getAccountInfoSync().miniProgram.envVersion;
if(!that._oid || that._oid == 0){
return false;
}
that.G.Get(
that.api.bind_getOrderCode,
{
env: _env,
orderId:that._oid,
relationId:that._rid
},
(res) => {
console.log("获取邀请码:", res);
that.wxCode = "https://daotian.matripe.com.cn" + res.qrcode;
that.agencyName = res.agencyName;
// #ifdef MP-WEIXIN
console.log("canvasRes1");
that.getWXCanvas("https://matripe-cms.oss-cn-beijing.aliyuncs.com/dailibaoming/canvasBg.png").then((canvasRes) => {
console.log("canvasRes", canvasRes);
that.shareJobImg = canvasRes.tempFilePath;
that.allowClick = true;
that.$emit("setImg", that.shareJobImg);
});
that.$emit("exportCode", {
code: res.code,
agencyName: res.agencyName,
});
// #endif
}
);
},
//
getWXCanvas(sharelImg, type) {
const that = this;
return new Promise((resolve) => {
var mycenter = 0; //
var myheight = 0; //
const query = uni.createSelectorQuery().in(this);
query
.select("#canvasId")
.fields({
node: true,
size: true,
})
.exec((res) => {
console.log("uni 获取节点信息:", res);
// console.log("sharelImg", sharelImg);
const canvas = res[0].node;
const ctx = canvas.getContext("2d");
new Promise(function (resolve) {
//
uni.getImageInfo({
src: sharelImg, //
success(res) {
console.log("res111", res);
canvas.width = res.width;
canvas.height = res.height;
mycenter = canvas.width;
myheight = canvas.height;
const img = canvas.createImage();
img.src = res.path;
console.log("img111", img);
img.onload = (info) => {
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
console.log("info111", info);
resolve(true);
};
},
fail(err) {},
});
}).then(() => {
//使
this.setShareJobImg(ctx, canvas, mycenter)
.then(function (canvas1) {
console.log("canvas1", canvas1);
uni.canvasToTempFilePath({
canvas: canvas1,
success(res) {
console.log("res222", res);
resolve(res);
},
fail(res) {
uni.hideLoading();
uni.showToast({
title: res.errMsg,
icon: "error",
});
},
});
})
.catch((err) => {
uni.hideLoading();
uni.showToast({
title: "生成失败,请重试",
});
});
});
});
});
},
//
saveWXImageToAlbum() {
let that = this;
uni.saveImageToPhotosAlbum({
filePath: that.shareJobImg,
success() {
uni.showToast({
title: "保存成功",
});
},
fail(err) {
uni.showToast({
title: "保存失败, 请重试",
});
},
});
},
//
setShareJobImg(ctx, canvas, mycenter, funObj) {
let that = this;
return new Promise((imgres) => {
uni.getImageInfo({
src: that.wxCode,
success(res) {
const img = canvas.createImage();
console.log("res333", res);
img.src = res.path;
img.onload = () => {
that.G.roundRect(ctx, img, (mycenter - 488) / 2, 1160, 488, 488, 0);
let info = that.recommendList;
console.log("info", info);
if (!info.logo) {
info.logo = "https://matripe-cms.oss-cn-beijing.aliyuncs.com/ibocai/defaultAvatar.png";
}
console.log("that.recommendList333", that.recommendList);
uni.getImageInfo({
src: info.logo,
success(res) {
console.log("res444", res);
const img = canvas.createImage();
img.src = res.path;
img.onload = () => {
that.G.roundRect(ctx, img, 915, 218, 272, 272, 136); // logo
that.G.fillTextLineBreak(ctx, that._name, 140, 300, that._name.length * 80, 80, "#333", 80, 600, "left"); //
that.G.fillTextLineBreak(ctx, that._job, 140, 400, that._job.length * 56, 56, "#999", 56, 500, "left"); //
// that.G.fillTextLineBreak(ctx, info.jobNum.toString(), 230, 620, info.jobNum.toString().length * 88, 88, "#333", 88, 600); //
// that.G.fillTextLineBreak(ctx, info.recruitmentJobNum.toString(), 480, 620, info.recruitmentJobNum.toString().length * 88, 88, "#333", 88, 600); //
// that.G.fillTextLineBreak(ctx, info.downNum.toString(), 730, 620, info.downNum.toString().length * 88, 88, "#333", 88, 600); //
// that.G.fillTextLineBreak(ctx, "", 230, 700, "".length * 56, 56, "#999", 56, 500); //
// that.G.fillTextLineBreak(ctx, "", 480, 700, "".length * 56, 56, "#999", 56, 500); //
// that.G.fillTextLineBreak(ctx, "", 730, 700, "".length * 56, 56, "#999", 56, 500); //
imgres(canvas);
};
},
fail(err) {},
});
};
},
fail(err) {},
});
});
},
//
handleOpenCamera() {
let that = this;
that.G.handleScanCode();
},
},
};
</script>
<style lang="scss">
.p-root-bind-my-main {
background-size: 100% 100%;
background-repeat: no-repeat;
.canvas-card {
background-size: 100% 100%;
background-repeat: no-repeat;
width: calc(100vw - 32px);
height: calc(calc(100vw - 32px) * 2248 / 1372);
}
.m-card {
top: calc(calc(calc(100vw - 32px) * 2248 / 1372) * (36 / 562));
border-radius: 15px;
width: calc(100vw - 74px);
height: calc(calc(calc(100vw - 32px) * 2248 / 1372) * (198 / 562));
}
}
</style>
Loading…
Cancel
Save