master
wangxia 2 months ago
parent 751ed31b0f
commit 9e3cd94e61

@ -34,7 +34,7 @@ export function createApp () {
app.config.productionTip = false; app.config.productionTip = false;
app.component('g-empty', gEmpty); app.component('g-empty', gEmpty);
app.component('g-tabbar', gTabbar); app.component('g-tabbar', gTabbar);
app.component('g-loading', gLoading); app.component('g-loading', gLoading);
app.component('g-button', gButton); app.component('g-button', gButton);
app.component('g-list-job', gListJob); app.component('g-list-job', gListJob);
@ -85,7 +85,8 @@ export function createApp () {
console.log(err); console.log(err);
resolve(err) resolve(err)
}) }
)
}) })
}, },
/* /*
@ -99,7 +100,7 @@ export function createApp () {
uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id方便获取 uni.setStorageSync("apply-agencyId", res.user.agencyId); // 单独存储 -- 代理id方便获取
uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号 uni.setStorageSync("apply-supplierAccount", res.supplierAccount); // 单独存储 -- 是否是发单号,方便获取 0.不是发单号 1.是发单号
if (res.agencyId) { if (res.agencyId) {
// if (res.agencyStatus == 1) { // if (res.agencyStatus == 1) {
G.Get(apiInfo.login_agencyInfo, {}, (aRes) => { G.Get(apiInfo.login_agencyInfo, {}, (aRes) => {
uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员 uni.setStorageSync("agencyInfo", aRes.agency); // 1是创建者 2是普通成员
uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员 uni.setStorageSync("IS_CREATOR", aRes.agency.userId == res.user.id || res.admin == true ? 1 : 2); // 1是创建者 2是普通成员
@ -167,59 +168,7 @@ export function createApp () {
}); });
}, $sourceType); }, $sourceType);
}, },
// 新增方法:生成 UUID
getUUID () {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0;
const v = c === "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
},
/**
* 上传到oss
*/
uploadImgToOss (callback = () => { }, customDir = '', type = 'default', $num = 1, $sourceType = ['album', 'camera']) {
var that = this;
G.uploadImage($num, (imgRes) => {
uni.showLoading({
title: '上传中...',
})
console.log('imgRes', imgRes);
let imgPath = JSON.parse(imgRes)[0]
console.log('imgPath', imgPath);
G.Get(apiInfo.getOssInfo, { prefix: customDir }, ({ data }) => {
console.log('uploadImgToOssresresresres', data);
const { policy, signature, accessid, dir, host } = data;
let key = dir + that.getUUID()
const formData = {
"key": key + "_${filename}",
"policy": policy,
"OSSAccessKeyId": accessid,
signature,
"success_action_status": "200",
};
uni.uploadFile({
url: host,
filePath: imgPath,
name: "file",
formData: formData,
success: function (res) {
if (res.errMsg = "uploadFile:ok") {
const imgUrl = `${host}/${key}_${imgPath.split('/').pop()}`;
callback({
status: '上传成功',
image: imgUrl
});
}
console.log('resresresresresresres', res);
},
fail: function (res) { },
});
})
})
},
/* /*
*/ */
uploadImgByCamera (callback = () => { }, type = 'default', $num = 1, $sourceType = ['camera']) { uploadImgByCamera (callback = () => { }, type = 'default', $num = 1, $sourceType = ['camera']) {

@ -113,22 +113,26 @@ export default {
components: {}, components: {},
// //
props: { props: {
//
userInfo: { userInfo: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {};
}, },
}, },
//
agencyInfo: { agencyInfo: {
type: Object, type: Object,
default: () => { default: () => {
return {}; return {};
}, },
}, },
//
shareAgencyId: { shareAgencyId: {
type: String, type: String,
default: "", default: "",
}, },
//
navNewPage: { navNewPage: {
type: Boolean, type: Boolean,
default: true, default: true,

@ -19,7 +19,7 @@
</view> </view>
</view> </view>
<div class="con-obj" style="background-color: #caf1e0 !important"> <div class="con-obj" style="background-color: #caf1e0 !important">
<view class="m-info g_p_20 g_pt_12 g_pb_0 g_bg_f g_position_rela" hover-class="none" style="margin-top: 0; border-radius: 8px 8px 0 0; width: calc(100% - 40px)"> <view class="m-info g_p_20 g_pt_12 g_pb_8 g_bg_f g_position_rela" hover-class="none" style="margin-top: 0; border-radius: 8px 8px 0 0; width: calc(100% - 40px)">
<view class="g_flex_row_start"> <view class="g_flex_row_start">
<view class="g_w_71"> <view class="g_w_71">
<view class="g_position_abso g_p_4 g_radius_50 g_bg_f" style="top: -20px"> <view class="g_position_abso g_p_4 g_radius_50 g_bg_f" style="top: -20px">
@ -53,7 +53,7 @@
</div> </div>
<div class="g_h_10"></div> <div class="g_h_10"></div>
<div class> <div class="">
<quickLogin @successLogin="successLogin" v-if="!isLogin"> <quickLogin @successLogin="successLogin" v-if="!isLogin">
<div style="width: calc(100vw - 40px)" class> <div style="width: calc(100vw - 40px)" class>
<g-button btnText="申请关注" size="auto" type="primary" class></g-button> <g-button btnText="申请关注" size="auto" type="primary" class></g-button>
@ -101,7 +101,7 @@
</template> </template>
</div> </div>
</view> </view>
<div class="g_bg_f g_pt_8" v-if="info.recordStatus == 1 || info.recordStatus == 2"> <div class="g_bg_f =" v-if="info.recordStatus == 1 || info.recordStatus == 2">
<u-tabs bg-color="transparent" from="index" gutter="20" :list="tabInfo.list" :is-scroll="true" v-model="tabInfo.active" active-color="#000" bar-width="64" bar-height="6" @change="handleUpdateTab" font-size="32" duration="0.05" height="56"></u-tabs> <u-tabs bg-color="transparent" from="index" gutter="20" :list="tabInfo.list" :is-scroll="true" v-model="tabInfo.active" active-color="#000" bar-width="64" bar-height="6" @change="handleUpdateTab" font-size="32" duration="0.05" height="56"></u-tabs>
</div> </div>

@ -45,7 +45,7 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
console.log(options); console.log('options',options);
// options.scene = "id=3087_101125"; // options.scene = "id=3087_101125";
if (uni.getStorageSync("scene") || options.scene) { if (uni.getStorageSync("scene") || options.scene) {
console.log("XXXXXXXXXXXX"); console.log("XXXXXXXXXXXX");

Loading…
Cancel
Save