This commit is contained in:
18631081161 2025-07-31 21:42:37 +08:00
parent c7ea42ed79
commit 362948739b
16 changed files with 481 additions and 361 deletions

View File

@ -23,6 +23,11 @@
display: flex;
flex-direction: row;
}
.row-reverse {
display: flex;
flex-direction: row-reverse;
}
.center {
display: flex;

View File

@ -28,54 +28,48 @@
<view class="column"
style="width: 550rpx; background-color: white; align-items: center;margin-top: 20rpx;border-radius: 16rpx; padding-bottom: 20rpx;">
<text style="font-size: 25rpx; color: black; margin-top: 10rpx;"> 收货地址填写 </text>
<text style="font-size: 25rpx; color: black; margin-top: 10rpx;">收货地址填写</text>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text style="margin-left: 60rpx;">姓名</text>
<input v-model="name" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">姓名</text>
<input v-model="name" type="text" style="margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text>联系方式</text>
<input v-model="phone" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">联系方式</text>
<input v-model="phone" type="text" style=" margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text>工作单位</text>
<input v-model="workUnit" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">工作单位</text>
<input v-model="workUnit" type="text" style="margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="justify-content: center; margin-top: 20rpx;">
<text style="margin-top: 20rpx;">收货地址</text>
<view class="row line">
<text style="margin-top: 20rpx; width: 110rpx;">收货地址</text>
<textarea v-model="address" placeholder="" :auto-height="false" :maxlength="-1"
style="height: 50px;border-bottom: 0.86px solid #000; width: 350rpx;margin-left: 50rpx;" />
style="height: 50px; width: 350rpx;margin-left: 50rpx;" />
</view>
</view>
<view class="column"
style="width: 550rpx; background-color: white; align-items: center;margin-top: 20rpx;border-radius: 16rpx; padding-bottom: 20rpx;">
<text style="font-size: 25rpx; color: black; margin-top: 40rpx;"> 产品信息填写 </text>
<text style="font-size: 25rpx; color: black; margin-top: 40rpx;">产品信息填写</text>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text style="margin-left: 60rpx;">型号</text>
<input v-model="model" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">型号</text>
<input v-model="model" type="text" style="margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text>出品编号</text>
<input v-model="number" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">出品编号</text>
<input v-model="number" type="text" style="margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="width: 100%; justify-content: center; margin-top: 20rpx;">
<text>出品年月</text>
<input v-model="createTime" type="text"
style="border-bottom: 0.86px solid #000; margin-left: 50rpx; width: 350rpx;" />
<view class="row line">
<text style="width: 110rpx;">出品年月</text>
<input v-model="createTime" type="text" style="margin-left: 50rpx; width: 350rpx;" />
</view>
<view class="row" style="width: 100%; margin-top: 40rpx; align-items: flex-start; flex-wrap: wrap;">
@ -91,13 +85,13 @@
<text style="font-size: 22rpx; margin-top: 20rpx;width: 90%;">拍摄并上传清晰的产品铭牌信息用于辅助审核通过后立即发货</text>
</view>
<view class="row" style="width: 100%; justify-content: space-around; margin-top: 40rpx;">
<view class="row" style="width: 550rpx; justify-content: space-between; margin-top: 40rpx;">
<view class="center" @click="closeReceivePop"
style="width: 150rpx; height: 80rpx; background-color: #CCCCCC; border-radius: 16rpx;">
<text style="font-size: 28rpx; color: #333;">关闭</text>
</view>
<view class="center" @click="submitForm"
style="width: 350rpx; height: 80rpx; background-color: #0877FF; border-radius: 16rpx;position: relative;left: -20rpx;">
style="width: 350rpx; height: 80rpx; background-color: #0877FF; border-radius: 16rpx;position: relative;">
<text style="font-size: 28rpx; color: white;">提交</text>
</view>
</view>
@ -147,275 +141,335 @@
</template>
<script>
import uniNoticeBar from '@/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue'
import { processImage } from '@/common/utils'
export default {
components: {
uniNoticeBar
},
onLoad() {
this.getConfig();
var userId = uni.getStorageSync("user_id");
if (!userId || userId == 0) {
this.login();
}
this.userId = userId;
},
data() {
return {
bg: "",
userId: 0,
imagePath: '',
name: "",
phone: "",
base64: "",
workUnit: "",
address: "",
createTime: "",
number: "",
model: "",
recordList: []
}
},
import uniNoticeBar from '@/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue'
import {
processImage
} from '@/common/utils'
export default {
components: {
uniNoticeBar
},
onLoad() {
this.getConfig();
var userId = uni.getStorageSync("user_id");
if (!userId || userId == 0) {
this.login();
}
this.userId = userId;
},
data() {
return {
bg: "",
userId: 0,
imagePath: '',
name: "",
phone: "",
base64: "",
workUnit: "",
address: "",
createTime: "",
number: "",
model: "",
recordList: []
}
},
methods: {
request(url, method, data) {
return new Promise((resolve, reject) => {
const header = {
methods: {
request(url, method, data) {
return new Promise((resolve, reject) => {
const header = {
};
if (method == "post") {
header['content-type'] = 'application/json';
}
uni.request({
url: "http://localhost:8888/" + url,
method: method,
data: data,
header: header,
timeout: 10000,
success: (res) => {
console.log('API响应:', res);
if (res.statusCode === 200) {
resolve(res.data);
} else {
reject(new Error(`请求失败,状态码: ${res.statusCode}`));
};
if (method == "post") {
header['content-type'] = 'application/json';
}
uni.request({
url: "http://localhost:8888/" + url,
method: method,
data: data,
header: header,
timeout: 10000,
success: (res) => {
console.log('API响应:', res);
if (res.statusCode === 200) {
resolve(res.data);
} else {
reject(new Error(`请求失败,状态码: ${res.statusCode}`));
}
},
fail: (err) => {
console.error('API请求失败:', err);
reject(err);
}
},
fail: (err) => {
console.error('API请求失败:', err);
reject(err);
}
});
})
},
async getConfig() {
const res = await this.request("config", "get", {});
console.log(res);
if (res.home != "") {
this.bg = res.home;
}
},
wxLogin() {
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin', //使
onlyAuthorize: true,
success: async function (res) {
// if()
resolve(res.code);
},
fail: function (err) {
reject(err);
}
});
})
})
},
async login() {
try {
const wxCode = await this.wxLogin();
if (wxCode) {
const res = await this.request("userLogin?code=" + wxCode, "post", {});
if (res.code == 200) {
uni.setStorageSync("user_id", res.data.user_id);
this.userId = res.data.user_id;
console.log('登录成功, userId:', this.userId);
} else {
console.error('登录失败:', res.message);
}
},
async getConfig() {
const res = await this.request("config", "get", {});
console.log(res);
if (res.home != "") {
this.bg = res.home;
}
} catch (error) {
console.error('登录过程出错:', error);
}
},
openReceivePop() {
this.$refs.receivePop.open();
},
},
wxLogin() {
return new Promise((resolve, reject) => {
uni.login({
provider: 'weixin', //使
onlyAuthorize: true,
success: async function(res) {
// if()
resolve(res.code);
},
fail: function(err) {
reject(err);
}
})
})
closeReceivePop() {
this.$refs.receivePop.close();
},
},
async login() {
try {
const wxCode = await this.wxLogin();
if (wxCode) {
const res = await this.request("userLogin?code=" + wxCode, "post", {});
if (res.code == 200) {
uni.setStorageSync("user_id", res.data.user_id);
this.userId = res.data.user_id;
console.log('登录成功, userId:', this.userId);
} else {
console.error('登录失败:', res.message);
}
}
} catch (error) {
console.error('登录过程出错:', error);
}
},
openReceivePop() {
this.$refs.receivePop.open();
},
async openRecordPop() {
await this.loadRecordList();
this.$refs.recordPop.open();
},
closeReceivePop() {
this.$refs.receivePop.close();
},
async loadRecordList() {
try {
uni.showLoading({ title: '加载中...' });
// API
const result = await this.request('getRecord?userId=' + this.userId, 'GET', {});
console.log(result);
this.recordList = result.data;
async openRecordPop() {
await this.loadRecordList();
this.$refs.recordPop.open();
},
async loadRecordList() {
try {
uni.showLoading({
title: '加载中...'
});
// API
const result = await this.request('getRecord?userId=' + this.userId, 'GET', {});
console.log(result);
this.recordList = result.data;
// 使
console.log('加载领取记录...');
} catch (error) {
console.error('加载领取记录失败:', error);
}
uni.hideLoading();
},
closeRecordPop() {
this.$refs.recordPop.close();
},
async seleImg() {
try {
uni.showLoading({ title: '处理中...' });
const { base64, path } = await processImage();
console.log('最终Base64长度:', base64.length, path);
this.imagePath = path;
this.base64 = base64;
uni.showToast({ title: '上传成功' });
} catch (err) {
console.error('处理失败', err);
uni.showToast({ title: '处理失败', icon: 'none' });
} finally {
uni.hideLoading();
}
},
validateForm() {
if (!this.name.trim()) {
uni.showToast({ title: '请填写姓名', icon: 'none' });
return false;
}
if (!this.phone.trim()) {
uni.showToast({ title: '请填写联系方式', icon: 'none' });
return false;
}
if (!this.workUnit.trim()) {
uni.showToast({ title: '请填写工作单位', icon: 'none' });
return false;
}
if (!this.address.trim()) {
uni.showToast({ title: '请填写收货地址', icon: 'none' });
return false;
}
if (!this.model.trim()) {
uni.showToast({ title: '请填写设备型号', icon: 'none' });
return false;
}
if (!this.number.trim()) {
uni.showToast({ title: '请填写出品编号', icon: 'none' });
return false;
}
if (!this.createTime.trim()) {
uni.showToast({ title: '请填写出品年月', icon: 'none' });
return false;
}
if (!this.imagePath) {
uni.showToast({ title: '请上传产品铭牌照片', icon: 'none' });
return false;
}
return true;
},
async submitForm() {
if (!this.validateForm()) {
return;
}
uni.showLoading({ title: '提交中...' });
try {
const formData = {
UserId: this.userId,
Name: this.name,
Phone: this.phone,
Company: this.workUnit,
Address: this.address,
ProductModel: this.model,
ProductSerialNumber: this.number,
ProductDate: this.createTime,
ProductImage: this.base64
};
// API
const result = await this.request('addRecord', 'POST', formData);
console.log(result);
if (result.code == 200) {
uni.showToast({ title: '提交成功,请等待审核', icon: 'success' });
this.closeReceivePop();
this.clearForm();
} else {
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
// 使
console.log('加载领取记录...');
} catch (error) {
console.error('加载领取记录失败:', error);
}
uni.hideLoading();
},
} catch (error) {
uni.hideLoading();
uni.showToast({ title: '提交失败,请重试', icon: 'none' });
console.error('提交失败:', error);
}
},
closeRecordPop() {
this.$refs.recordPop.close();
},
clearForm() {
this.name = '';
this.phone = '';
this.workUnit = '';
this.address = '';
this.model = '';
this.number = '';
this.createTime = '';
this.imagePath = '';
this.base64 = '';
},
async seleImg() {
try {
uni.showLoading({
title: '处理中...'
});
previewImage() {
if (this.imagePath) {
uni.previewImage({
current: this.imagePath,
urls: [this.imagePath],
success: function (res) {
console.log('预览图片成功');
},
fail: function (err) {
console.error('预览图片失败:', err);
uni.showToast({ title: '预览失败', icon: 'none' });
}
const {
base64,
path
} = await processImage();
console.log('最终Base64长度:', base64.length, path);
this.imagePath = path;
this.base64 = base64;
uni.showToast({
title: '上传成功'
});
} catch (err) {
console.error('处理失败', err);
uni.showToast({
title: '处理失败',
icon: 'none'
});
} finally {
uni.hideLoading();
}
},
validateForm() {
if (!this.name.trim()) {
uni.showToast({
title: '请填写姓名',
icon: 'none'
});
return false;
}
if (!this.phone.trim()) {
uni.showToast({
title: '请填写联系方式',
icon: 'none'
});
return false;
}
if (!this.workUnit.trim()) {
uni.showToast({
title: '请填写工作单位',
icon: 'none'
});
return false;
}
if (!this.address.trim()) {
uni.showToast({
title: '请填写收货地址',
icon: 'none'
});
return false;
}
if (!this.model.trim()) {
uni.showToast({
title: '请填写设备型号',
icon: 'none'
});
return false;
}
if (!this.number.trim()) {
uni.showToast({
title: '请填写出品编号',
icon: 'none'
});
return false;
}
if (!this.createTime.trim()) {
uni.showToast({
title: '请填写出品年月',
icon: 'none'
});
return false;
}
if (!this.imagePath) {
uni.showToast({
title: '请上传产品铭牌照片',
icon: 'none'
});
return false;
}
return true;
},
async submitForm() {
if (!this.validateForm()) {
return;
}
uni.showLoading({
title: '提交中...'
});
}
}
try {
const formData = {
UserId: this.userId,
Name: this.name,
Phone: this.phone,
Company: this.workUnit,
Address: this.address,
ProductModel: this.model,
ProductSerialNumber: this.number,
ProductDate: this.createTime,
ProductImage: this.base64
};
// API
const result = await this.request('addRecord', 'POST', formData);
console.log(result);
if (result.code == 200) {
uni.showToast({
title: '提交成功,请等待审核',
icon: 'success'
});
this.closeReceivePop();
this.clearForm();
} else {
uni.showToast({
title: '提交失败,请重试',
icon: 'none'
});
}
uni.hideLoading();
} catch (error) {
uni.hideLoading();
uni.showToast({
title: '提交失败,请重试',
icon: 'none'
});
console.error('提交失败:', error);
}
},
clearForm() {
this.name = '';
this.phone = '';
this.workUnit = '';
this.address = '';
this.model = '';
this.number = '';
this.createTime = '';
this.imagePath = '';
this.base64 = '';
},
previewImage() {
if (this.imagePath) {
uni.previewImage({
current: this.imagePath,
urls: [this.imagePath],
success: function(res) {
console.log('预览图片成功');
},
fail: function(err) {
console.error('预览图片失败:', err);
uni.showToast({
title: '预览失败',
icon: 'none'
});
}
});
}
}
}
}
}
</script>
<style>
.content {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.content {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.line {
width: 90%;
justify-content: center;
margin-top: 20rpx;
border-bottom: 0.86px solid #e3e3e3;
}
</style>

View File

@ -1 +1 @@
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n\t.column {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: column;\r\n\t}\r\n\r\n\t.row {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: row;\r\n\t}\r\n\r\n\t.center {\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t}\r\n</style>","import App from './App'\r\n\r\n// #ifndef VUE3\r\nimport Vue from 'vue'\r\nimport './uni.promisify.adaptor'\r\nVue.config.productionTip = false\r\nApp.mpType = 'app'\r\nconst app = new Vue({\r\n ...App\r\n})\r\napp.$mount()\r\n// #endif\r\n\r\n// #ifdef VUE3\r\nimport { createSSRApp } from 'vue'\r\nexport function createApp() {\r\n const app = createSSRApp(App)\r\n return {\r\n app\r\n }\r\n}\r\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}
{"version":3,"file":"app.js","sources":["App.vue","main.js"],"sourcesContent":["<script>\r\n\texport default {\r\n\t\tonLaunch: function() {\r\n\t\t\tconsole.log('App Launch')\r\n\t\t},\r\n\t\tonShow: function() {\r\n\t\t\tconsole.log('App Show')\r\n\t\t},\r\n\t\tonHide: function() {\r\n\t\t\tconsole.log('App Hide')\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n\t.column {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: column;\r\n\t}\r\n\r\n\t.row {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: row;\r\n\t}\r\n\t\r\n\t.row-reverse {\r\n\t\tdisplay: flex;\r\n\t\tflex-direction: row-reverse;\r\n\t}\r\n\r\n\t.center {\r\n\t\tdisplay: flex;\r\n\t\talign-items: center;\r\n\t\tjustify-content: center;\r\n\t}\r\n</style>","import App from './App'\n\n// #ifndef VUE3\nimport Vue from 'vue'\nimport './uni.promisify.adaptor'\nVue.config.productionTip = false\nApp.mpType = 'app'\nconst app = new Vue({\n ...App\n})\napp.$mount()\n// #endif\n\n// #ifdef VUE3\nimport { createSSRApp } from 'vue'\nexport function createApp() {\n const app = createSSRApp(App)\n return {\n app\n }\n}\n// #endif"],"names":["uni","createSSRApp","App"],"mappings":";;;;;;AACC,MAAK,YAAU;AAAA,EACd,UAAU,WAAW;AACpBA,kBAAAA,MAAA,MAAA,OAAA,gBAAY,YAAY;AAAA,EACxB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,gBAAA,UAAU;AAAA,EACtB;AAAA,EACD,QAAQ,WAAW;AAClBA,kBAAAA,MAAY,MAAA,OAAA,iBAAA,UAAU;AAAA,EACvB;AACD;ACIM,SAAS,YAAY;AAC1B,QAAM,MAAMC,cAAY,aAACC,SAAG;AAC5B,SAAO;AAAA,IACL;AAAA,EACD;AACH;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,6 +8,10 @@
display: flex;
flex-direction: row;
}
.row-reverse {
display: flex;
flex-direction: row-reverse;
}
.center {
display: flex;
align-items: center;

View File

@ -2671,15 +2671,11 @@ const getPublicInstance = (i) => {
return getExposeProxy(i) || i.proxy;
return getPublicInstance(i.parent);
};
function getComponentInternalInstance(i) {
return i;
}
const publicPropertiesMap = (
// Move PURE marker to new line to workaround compiler discarding it
// due to type annotation
/* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
// fixed by xxxxxx
$: getComponentInternalInstance,
$: (i) => i,
// fixed by xxxxxx vue-i18n 在 dev 模式,访问了 $el故模拟一个假的
// $el: i => i.vnode.el,
$el: (i) => i.__$el || (i.__$el = {}),
@ -4550,7 +4546,6 @@ function warnRef(ref2) {
const queuePostRenderEffect = queuePostFlushCb;
function mountComponent(initialVNode, options) {
const instance = initialVNode.component = createComponentInstance(initialVNode, options.parentComponent, null);
instance.renderer = options.mpType ? options.mpType : "component";
{
instance.ctx.$onApplyOptions = onApplyOptions;
instance.ctx.$children = [];
@ -4889,8 +4884,7 @@ function injectLifecycleHook(name, hook, publicThis, instance) {
}
function initHooks$1(options, instance, publicThis) {
const mpType = options.mpType || publicThis.$mpType;
if (!mpType || mpType === "component" || // instance.renderer 标识页面是否作为组件渲染
mpType === "page" && instance.renderer === "component") {
if (!mpType || mpType === "component") {
return;
}
Object.keys(options).forEach((name) => {
@ -5546,10 +5540,10 @@ function handlePromise(promise) {
function promisify$1(name, fn) {
return (args = {}, ...rest) => {
if (hasCallback(args)) {
return wrapperReturnValue(name, invokeApi(name, fn, extend({}, args), rest));
return wrapperReturnValue(name, invokeApi(name, fn, args, rest));
}
return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
invokeApi(name, fn, extend({}, args, { success: resolve2, fail: reject }), rest);
invokeApi(name, fn, extend(args, { success: resolve2, fail: reject }), rest);
})));
};
}
@ -5946,7 +5940,7 @@ function promisify(name, api) {
}
return function promiseApi(options = {}, ...rest) {
if (isFunction(options.success) || isFunction(options.fail) || isFunction(options.complete)) {
return wrapperReturnValue(name, invokeApi(name, api, extend({}, options), rest));
return wrapperReturnValue(name, invokeApi(name, api, options, rest));
}
return wrapperReturnValue(name, handlePromise(new Promise((resolve2, reject) => {
invokeApi(name, api, extend({}, options, {
@ -6113,7 +6107,7 @@ function getOSInfo(system, platform) {
osName = system.split(" ")[0] || platform;
osVersion = system.split(" ")[1] || "";
}
osName = osName.toLowerCase();
osName = osName.toLocaleLowerCase();
switch (osName) {
case "harmony":
case "ohos":
@ -6153,9 +6147,9 @@ function populateParameters(fromRes, toRes) {
appVersion: "1.0.0",
appVersionCode: "100",
appLanguage: getAppLanguage(hostLanguage),
uniCompileVersion: "4.75",
uniCompilerVersion: "4.75",
uniRuntimeVersion: "4.75",
uniCompileVersion: "4.65",
uniCompilerVersion: "4.65",
uniRuntimeVersion: "4.65",
uniPlatform: "mp-weixin",
deviceBrand,
deviceModel: model,
@ -6192,7 +6186,7 @@ function getGetDeviceType(fromRes, model) {
mac: "pc"
};
const deviceTypeMapsKeys = Object.keys(deviceTypeMaps);
const _model = model.toLowerCase();
const _model = model.toLocaleLowerCase();
for (let index2 = 0; index2 < deviceTypeMapsKeys.length; index2++) {
const _m = deviceTypeMapsKeys[index2];
if (_model.indexOf(_m) !== -1) {
@ -6206,7 +6200,7 @@ function getGetDeviceType(fromRes, model) {
function getDeviceBrand(brand) {
let deviceBrand = brand;
if (deviceBrand) {
deviceBrand = deviceBrand.toLowerCase();
deviceBrand = deviceBrand.toLocaleLowerCase();
}
return deviceBrand;
}
@ -6304,9 +6298,9 @@ const getAppBaseInfo = {
appLanguage: getAppLanguage(hostLanguage),
isUniAppX: false,
uniPlatform: "mp-weixin",
uniCompileVersion: "4.75",
uniCompilerVersion: "4.75",
uniRuntimeVersion: "4.75"
uniCompileVersion: "4.65",
uniCompilerVersion: "4.65",
uniRuntimeVersion: "4.65"
};
extend(toRes, parameters);
}
@ -6979,14 +6973,14 @@ const atFileRegex = /^\s*at\s+[\w/./-]+:\d+$/;
function rewriteConsole() {
function wrapConsole(type) {
return function(...args) {
{
const originalArgs = [...args];
if (originalArgs.length) {
const maybeAtFile = originalArgs[originalArgs.length - 1];
if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
originalArgs.pop();
}
const originalArgs = [...args];
if (originalArgs.length) {
const maybeAtFile = originalArgs[originalArgs.length - 1];
if (typeof maybeAtFile === "string" && atFileRegex.test(maybeAtFile)) {
originalArgs.pop();
}
}
{
originalConsole[type](...originalArgs);
}
if (type === "error" && args.length === 1) {
@ -7046,9 +7040,9 @@ function isConsoleWritable() {
return isWritable;
}
function initRuntimeSocketService() {
const hosts = "192.168.1.21,192.168.195.35,127.0.0.1";
const hosts = "172.23.128.1,192.168.1.7,192.168.195.32,127.0.0.1";
const port = "8090";
const id = "mp-weixin_XlaJbP";
const id = "mp-weixin_r5vw4B";
const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => {
} : initOnError();

View File

@ -45,7 +45,7 @@ const _sfc_main = {
header,
timeout: 1e4,
success: (res) => {
common_vendor.index.__f__("log", "at pages/index/index.vue:197", "API响应:", res);
common_vendor.index.__f__("log", "at pages/index/index.vue:193", "API响应:", res);
if (res.statusCode === 200) {
resolve(res.data);
} else {
@ -53,7 +53,7 @@ const _sfc_main = {
}
},
fail: (err) => {
common_vendor.index.__f__("error", "at pages/index/index.vue:205", "API请求失败:", err);
common_vendor.index.__f__("error", "at pages/index/index.vue:201", "API请求失败:", err);
reject(err);
}
});
@ -61,7 +61,7 @@ const _sfc_main = {
},
async getConfig() {
const res = await this.request("config", "get", {});
common_vendor.index.__f__("log", "at pages/index/index.vue:213", res);
common_vendor.index.__f__("log", "at pages/index/index.vue:209", res);
if (res.home != "") {
this.bg = res.home;
}
@ -89,13 +89,13 @@ const _sfc_main = {
if (res.code == 200) {
common_vendor.index.setStorageSync("user_id", res.data.user_id);
this.userId = res.data.user_id;
common_vendor.index.__f__("log", "at pages/index/index.vue:242", "登录成功, userId:", this.userId);
common_vendor.index.__f__("log", "at pages/index/index.vue:238", "登录成功, userId:", this.userId);
} else {
common_vendor.index.__f__("error", "at pages/index/index.vue:244", "登录失败:", res.message);
common_vendor.index.__f__("error", "at pages/index/index.vue:240", "登录失败:", res.message);
}
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:248", "登录过程出错:", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:244", "登录过程出错:", error);
}
},
openReceivePop() {
@ -110,13 +110,15 @@ const _sfc_main = {
},
async loadRecordList() {
try {
common_vendor.index.showLoading({ title: "加载中..." });
common_vendor.index.showLoading({
title: "加载中..."
});
const result = await this.request("getRecord?userId=" + this.userId, "GET", {});
common_vendor.index.__f__("log", "at pages/index/index.vue:269", result);
common_vendor.index.__f__("log", "at pages/index/index.vue:267", result);
this.recordList = result.data;
common_vendor.index.__f__("log", "at pages/index/index.vue:274", "加载领取记录...");
common_vendor.index.__f__("log", "at pages/index/index.vue:272", "加载领取记录...");
} catch (error) {
common_vendor.index.__f__("error", "at pages/index/index.vue:276", "加载领取记录失败:", error);
common_vendor.index.__f__("error", "at pages/index/index.vue:274", "加载领取记录失败:", error);
}
common_vendor.index.hideLoading();
},
@ -125,50 +127,84 @@ const _sfc_main = {
},
async seleImg() {
try {
common_vendor.index.showLoading({ title: "处理中..." });
const { base64, path } = await common_utils.processImage();
common_vendor.index.__f__("log", "at pages/index/index.vue:290", "最终Base64长度:", base64.length, path);
common_vendor.index.showLoading({
title: "处理中..."
});
const {
base64,
path
} = await common_utils.processImage();
common_vendor.index.__f__("log", "at pages/index/index.vue:293", "最终Base64长度:", base64.length, path);
this.imagePath = path;
this.base64 = base64;
common_vendor.index.showToast({ title: "上传成功" });
common_vendor.index.showToast({
title: "上传成功"
});
} catch (err) {
common_vendor.index.__f__("error", "at pages/index/index.vue:295", "处理失败", err);
common_vendor.index.showToast({ title: "处理失败", icon: "none" });
common_vendor.index.__f__("error", "at pages/index/index.vue:300", "处理失败", err);
common_vendor.index.showToast({
title: "处理失败",
icon: "none"
});
} finally {
common_vendor.index.hideLoading();
}
},
validateForm() {
if (!this.name.trim()) {
common_vendor.index.showToast({ title: "请填写姓名", icon: "none" });
common_vendor.index.showToast({
title: "请填写姓名",
icon: "none"
});
return false;
}
if (!this.phone.trim()) {
common_vendor.index.showToast({ title: "请填写联系方式", icon: "none" });
common_vendor.index.showToast({
title: "请填写联系方式",
icon: "none"
});
return false;
}
if (!this.workUnit.trim()) {
common_vendor.index.showToast({ title: "请填写工作单位", icon: "none" });
common_vendor.index.showToast({
title: "请填写工作单位",
icon: "none"
});
return false;
}
if (!this.address.trim()) {
common_vendor.index.showToast({ title: "请填写收货地址", icon: "none" });
common_vendor.index.showToast({
title: "请填写收货地址",
icon: "none"
});
return false;
}
if (!this.model.trim()) {
common_vendor.index.showToast({ title: "请填写设备型号", icon: "none" });
common_vendor.index.showToast({
title: "请填写设备型号",
icon: "none"
});
return false;
}
if (!this.number.trim()) {
common_vendor.index.showToast({ title: "请填写出品编号", icon: "none" });
common_vendor.index.showToast({
title: "请填写出品编号",
icon: "none"
});
return false;
}
if (!this.createTime.trim()) {
common_vendor.index.showToast({ title: "请填写出品年月", icon: "none" });
common_vendor.index.showToast({
title: "请填写出品年月",
icon: "none"
});
return false;
}
if (!this.imagePath) {
common_vendor.index.showToast({ title: "请上传产品铭牌照片", icon: "none" });
common_vendor.index.showToast({
title: "请上传产品铭牌照片",
icon: "none"
});
return false;
}
return true;
@ -177,7 +213,9 @@ const _sfc_main = {
if (!this.validateForm()) {
return;
}
common_vendor.index.showLoading({ title: "提交中..." });
common_vendor.index.showLoading({
title: "提交中..."
});
try {
const formData = {
UserId: this.userId,
@ -191,19 +229,28 @@ const _sfc_main = {
ProductImage: this.base64
};
const result = await this.request("addRecord", "POST", formData);
common_vendor.index.__f__("log", "at pages/index/index.vue:361", result);
common_vendor.index.__f__("log", "at pages/index/index.vue:395", result);
if (result.code == 200) {
common_vendor.index.showToast({ title: "提交成功,请等待审核", icon: "success" });
common_vendor.index.showToast({
title: "提交成功,请等待审核",
icon: "success"
});
this.closeReceivePop();
this.clearForm();
} else {
common_vendor.index.showToast({ title: "提交失败,请重试", icon: "none" });
common_vendor.index.showToast({
title: "提交失败,请重试",
icon: "none"
});
}
common_vendor.index.hideLoading();
} catch (error) {
common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: "提交失败,请重试", icon: "none" });
common_vendor.index.__f__("error", "at pages/index/index.vue:375", "提交失败:", error);
common_vendor.index.showToast({
title: "提交失败,请重试",
icon: "none"
});
common_vendor.index.__f__("error", "at pages/index/index.vue:418", "提交失败:", error);
}
},
clearForm() {
@ -223,11 +270,14 @@ const _sfc_main = {
current: this.imagePath,
urls: [this.imagePath],
success: function(res) {
common_vendor.index.__f__("log", "at pages/index/index.vue:397", "预览图片成功");
common_vendor.index.__f__("log", "at pages/index/index.vue:440", "预览图片成功");
},
fail: function(err) {
common_vendor.index.__f__("error", "at pages/index/index.vue:400", "预览图片失败:", err);
common_vendor.index.showToast({ title: "预览失败", icon: "none" });
common_vendor.index.__f__("error", "at pages/index/index.vue:443", "预览图片失败:", err);
common_vendor.index.showToast({
title: "预览失败",
icon: "none"
});
}
});
}
@ -279,7 +329,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
} : {}, {
y: common_vendor.o((...args) => $options.closeReceivePop && $options.closeReceivePop(...args)),
z: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args)),
A: common_vendor.sr("receivePop", "6e486efd-1"),
A: common_vendor.sr("receivePop", "8f702d68-1"),
B: common_vendor.p({
type: "center",
["is-mask-click"]: false
@ -295,7 +345,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
e: item.phone + item.time
};
}),
F: common_vendor.sr("recordPop", "6e486efd-2"),
F: common_vendor.sr("recordPop", "8f702d68-2"),
G: common_vendor.p({
type: "center"
})

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,16 @@
.content {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.line {
width: 90%;
justify-content: center;
margin-top: 20rpx;
border-bottom: 0.86px solid #e3e3e3;
}

View File

@ -0,0 +1,7 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "gift",
"setting": {
"compileHotReLoad": true
}
}

View File

@ -1 +1 @@
<view wx:if="{{a}}" class="{{['uni-popup', k, l]}}"><view bindtouchstart="{{j}}"><uni-transition wx:if="{{b}}" key="1" bindclick="{{c}}" u-i="15c4226a-0" bind:__l="__l" u-p="{{d}}"/><uni-transition wx:if="{{i}}" u-s="{{['d']}}" key="2" bindclick="{{h}}" u-i="15c4226a-1" bind:__l="__l" u-p="{{i}}"><view style="{{e}}" class="{{['uni-popup__wrapper', f]}}" bindtap="{{g}}"><slot/></view></uni-transition></view></view>
<view wx:if="{{a}}" class="{{['uni-popup', k, l]}}"><view bindtouchstart="{{j}}"><uni-transition wx:if="{{b}}" key="1" bindclick="{{c}}" u-i="53c4cdbb-0" bind:__l="__l" u-p="{{d}}"/><uni-transition wx:if="{{i}}" u-s="{{['d']}}" key="2" bindclick="{{h}}" u-i="53c4cdbb-1" bind:__l="__l" u-p="{{i}}"><view style="{{e}}" class="{{['uni-popup__wrapper', f]}}" bindtap="{{g}}"><slot/></view></uni-transition></view></view>