Browse Source

智能体

dev_des
1054425342@qq.com 4 weeks ago
parent
commit
a804917469
  1. 1
      components/GPT/index.vue
  2. 1
      components/GPT/utils/ClientData.js
  3. 10
      pages/agent/index.vue
  4. 48
      pages/index/timeShopBank.vue
  5. 100
      subPackages/haveFeeling/list.vue
  6. 154
      subPackages/techan/order.vue

1
components/GPT/index.vue

@ -408,6 +408,7 @@ export default {
this.scrollToBottom(1000) this.scrollToBottom(1000)
await this.socketObj.init() await this.socketObj.init()
this.$ClientData = new ClientData() this.$ClientData = new ClientData()
console.log(this.$ClientData,'ClientData')
this.$ClientData.init() this.$ClientData.init()
this.$ClientData.setAttr({ socketObj: this.socketObj }) this.$ClientData.setAttr({ socketObj: this.socketObj })
this.robotObj = this.socketObj.robotObj this.robotObj = this.socketObj.robotObj

1
components/GPT/utils/ClientData.js

@ -1,4 +1,3 @@
import Vue from "vue";
import { MESSAGE_TYPE } from "./chat_constant"; import { MESSAGE_TYPE } from "./chat_constant";
import { getQueryVariable, generateRequestId, arrayUnique } from "./util"; import { getQueryVariable, generateRequestId, arrayUnique } from "./util";
import { v4 as uuidv4 } from "uuid"; import { v4 as uuidv4 } from "uuid";

10
pages/agent/index.vue

@ -13,17 +13,19 @@ export default {
data() { data() {
return { return {
agentId:1 agentId:''
} }
}, },
onLoad(option) { onLoad(option) {
if(option){
this.agentId = option.id
console.log('>>>>>>接受的ID',this.agentId)
}
wx.hideShareMenu() wx.hideShareMenu()
const app = getApp(); const app = getApp();
const bgMusic = app.globalData.bgMusic; const bgMusic = app.globalData.bgMusic;
bgMusic.pause(); bgMusic.pause();
if(option){
this.agentId = option.id
}
}, },
onLaunch: options => { onLaunch: options => {
this.options = options this.options = options

48
pages/index/timeShopBank.vue

@ -76,7 +76,7 @@
/> />
</view> </view>
</view> </view>
<view class="fab-container"> <view class="fab-container" v-if="canPublish">
<image <image
@click="goToPublish" @click="goToPublish"
:src="showImg('/uploads/20250825/7ea7864b8abb89c3dd7834f025e49b3f.png')" :src="showImg('/uploads/20250825/7ea7864b8abb89c3dd7834f025e49b3f.png')"
@ -130,8 +130,24 @@ export default {
loading: false, loading: false,
hasMore: true, hasMore: true,
autoAddEnabled: false, autoAddEnabled: false,
whiteListUsers: [], // ID
}; };
}, },
computed: {
//
canPublish() {
//
if (!this.whiteListUsers || this.whiteListUsers.length === 0) {
return true;
}
//
if (!this.userInfo || !this.userInfo.id) {
return false;
}
// ID
return this.whiteListUsers.includes(this.userInfo.id.toString());
},
},
onLoad() { onLoad() {
this.userInfo = this.userInfo =
(uni.getStorageSync("userInfo") && (uni.getStorageSync("userInfo") &&
@ -147,6 +163,7 @@ export default {
onShow() { onShow() {
if (this.userInfo && this.userInfo.id) { if (this.userInfo && this.userInfo.id) {
this.getUserInfo(); this.getUserInfo();
this.getWhiteListConfig(); //
} }
}, },
@ -177,6 +194,21 @@ export default {
}); });
}, },
//
getWhiteListConfig() {
this.Post({}, `/system/config/configKey/note_white_user`, "DES")
.then((res) => {
if (res.code === 200) {
//
this.whiteListUsers = res.msg.split(",").map((item) => item.trim());
console.log("白名单用户列表:", this.whiteListUsers);
}
})
.catch((err) => {
console.error("获取白名单配置失败:", err);
});
},
// //
refreshFollowList() { refreshFollowList() {
// FollowTab // FollowTab
@ -272,6 +304,20 @@ export default {
}); });
return; return;
} }
//
const userId = this.userInfo.id.toString();
if (
this.whiteListUsers.length > 0 &&
!this.whiteListUsers.includes(userId)
) {
uni.showToast({
title: "暂无发布权限",
icon: "none",
});
return;
}
uni.navigateTo({ uni.navigateTo({
url: "/pages/notes/publish", url: "/pages/notes/publish",
}); });

100
subPackages/haveFeeling/list.vue

@ -30,11 +30,21 @@
<!-- 订单头部 - 供应商信息 --> <!-- 订单头部 - 供应商信息 -->
<view class="order-header"> <view class="order-header">
<view class="supplier-info"> <view class="supplier-info">
<view class="supplier-name" v-if="order.status==0||order.status==-1">有感商品订单</view> <view
<view class="supplier-name" v-else>{{ class="supplier-name"
order.supplierName || "默认供应商" v-if="order.status == 0 || order.status == -1"
}}</view> >有感商品订单</view
<view class="order-number">订单号{{ ( order.status==0||order.status==-1)?order.parentOrderNo:order.orderNo }}</view> >
<view class="supplier-name" v-else>{{
order.supplierName || "默认供应商"
}}</view>
<view class="order-number"
>订单号{{
order.status == 0 || order.status == -1
? order.parentOrderNo
: order.orderNo
}}</view
>
</view> </view>
<view class="order-status-wrapper"> <view class="order-status-wrapper">
<text class="status-name" :class="[getStatusClass(order.status)]">{{ <text class="status-name" :class="[getStatusClass(order.status)]">{{
@ -77,11 +87,27 @@
<!-- 订单底部 --> <!-- 订单底部 -->
<view class="order-footer"> <view class="order-footer">
<view class="order-info" > <view class="order-info">
<view class="order-total-section"> <view class="order-total-section">
<!-- <text class="total-label">{{(order.status==0)?'':'实付'}}</text> --> <!-- <text class="total-label">{{(order.status==0)?'':'实付'}}</text> -->
<text class="order-total" v-if="order.orders&&order.orders.length==1">¥{{ order.orders[0].payAmount || 0 }}</text> <view
<text class="order-total" v-else>¥{{ order.payAmount || 0 }}</text> class="order-total"
v-if="order.orders && order.orders.length == 1"
>¥{{ order.orders[0].payAmount || 0 }}
<span
class="freight-text"
v-if="Number(order.orders[0].shippingFee) != 0"
>含运费{{ order.orders[0].shippingFee || 0 }}</span
>
</view>
<view class="order-total" v-else
>¥{{ order.payAmount || 0
}}<span
class="freight-text"
v-if="Number(order.shippingFee) != 0"
>含运费{{ order.shippingFee || 0 }}</span
>
</view>
</view> </view>
<view class="order-time">{{ order.createTime }}</view> <view class="order-time">{{ order.createTime }}</view>
</view> </view>
@ -222,12 +248,12 @@ export default {
pageSize: this.pageSize, pageSize: this.pageSize,
status: this.tabs[this.currentTab].status, status: this.tabs[this.currentTab].status,
}; };
let url = '' let url = "";
if(this.currentTab==0||this.currentTab==1){ if (this.currentTab == 0 || this.currentTab == 1) {
url = "/framework/ygOrder/parent/pageList" url = "/framework/ygOrder/parent/pageList";
}else{ } else {
url = "/framework/ygOrder/pageList" url = "/framework/ygOrder/pageList";
} }
this.Post( this.Post(
{ {
...params, ...params,
@ -236,15 +262,15 @@ export default {
"DES" "DES"
).then((res) => { ).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(this.currentTab==0||this.currentTab==1){ if (this.currentTab == 0 || this.currentTab == 1) {
let orderItems = [] let orderItems = [];
res.rows.forEach(item =>{ res.rows.forEach((item) => {
item.orderItems = [] item.orderItems = [];
item.orders.forEach(_item =>{ item.orders.forEach((_item) => {
item.orderItems.push(..._item.orderItems) item.orderItems.push(..._item.orderItems);
}) });
}) });
} }
this.orderList.push(...res.rows); this.orderList.push(...res.rows);
console.log(this.orderList); console.log(this.orderList);
this.hasMore = res.rows.length === this.pageSize; this.hasMore = res.rows.length === this.pageSize;
@ -440,17 +466,16 @@ export default {
// //
goToOrderDetail(order) { goToOrderDetail(order) {
console.log(order) console.log(order);
if(order.status==-1||order.status==0){ if (order.status == -1 || order.status == 0) {
uni.navigateTo({ uni.navigateTo({
url: `/subPackages/haveFeeling/detailAll?id=${order.orderNo}`, url: `/subPackages/haveFeeling/detailAll?id=${order.orderNo}`,
}); });
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: `/subPackages/haveFeeling/detail?id=${order.orderNo}`, url: `/subPackages/haveFeeling/detail?id=${order.orderNo}`,
}); });
} }
}, },
}, },
}; };
@ -749,6 +774,13 @@ $bg-light: #f7fafc;
font-weight: 600; font-weight: 600;
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
"Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif; "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
.freight-text {
font-size: 22rpx;
color: $text-muted;
font-weight: 400;
margin-left: 8rpx;
}
} }
.order-time { .order-time {

154
subPackages/techan/order.vue

@ -96,8 +96,7 @@
</view> </view>
</view> </view>
<view class="commodity-info"> <view class="commodity-info">
<view class="text-overflowRows" <view class="text-overflowRows" style="width: 90%"
style="width: 90%;"
>{{ sku.specValueOne }}-{{ sku.specValueTwo }}</view >{{ sku.specValueOne }}-{{ sku.specValueTwo }}</view
> >
<view class="commodity-num"> x{{ sku.quantity }} </view> <view class="commodity-num"> x{{ sku.quantity }} </view>
@ -170,7 +169,9 @@
</view> </view>
<view class="price-detail"> <view class="price-detail">
<view class="text">运费:</view> <view class="text">运费:</view>
<view class="price">包邮</view> <view class="price">{{
post > 0 ? "¥" + post.toFixed(2) : "包邮"
}}</view>
</view> </view>
<view class="price-detail" v-if="usePoints > 0"> <view class="price-detail" v-if="usePoints > 0">
<view class="text">积分抵扣:</view> <view class="text">积分抵扣:</view>
@ -475,7 +476,7 @@ export default {
// //
async getTotalPoints() { async getTotalPoints() {
try { try {
if(!uni.getStorageSync("userInfo") )return if (!uni.getStorageSync("userInfo")) return;
this.Post({}, "/framework/points/getLastBalance", "DES").then((res) => { this.Post({}, "/framework/points/getLastBalance", "DES").then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.userPoints = res.data.balance || 0; this.userPoints = res.data.balance || 0;
@ -598,32 +599,9 @@ export default {
if (this.info.is_post == 0 || !this.contacts) { if (this.info.is_post == 0 || !this.contacts) {
return; return;
} }
this.flag = false;
let param = [];
this.info.goods.forEach((v) => {
param.push({
specifications_id: v.skuInfo.id,
num: v.skuInfo.quantity,
consignee_id: this.contacts.id,
});
});
let data = JSON.stringify(param); //
// console.log(data); this.calculateFreight();
this.Post({ data: data }, "/api/order/getNewPost")
.then((res) => {
if (res) {
for (let i = 0; i < this.info.goods.length; i++) {
this.info.goods[i].post = res.data[i].post_money;
}
this.flag = true;
}
})
.catch((err) => {
// console.log(err, "aaaaaaa");
this.flag = true;
});
}, },
plus(sku) { plus(sku) {
@ -800,10 +778,56 @@ export default {
return "¥" + allPriceYuan.toFixed(2); return "¥" + allPriceYuan.toFixed(2);
}, },
// //
getTotalPost() { getTotalPost() {
// 0 // 0
return 0; return this.post ? this.post : 0;
},
//
calculateFreight() {
if (!this.contacts) {
return;
}
this.flag = false;
//
let shoppingCartBoList = [];
this.info.forEach((sku) => {
shoppingCartBoList.push({
goodsId: sku.goodsId,
specId: sku.specId,
quantity: sku.quantity,
});
});
//
this.Post(
{
shoppingCartBoList: this.info,
userContactId: this.contacts.id,
method: "POST",
},
"/framework/ygOrder/calculateMultiSpecFreight",
"DES"
)
.then((res) => {
if (res && res.code === 200) {
this.post = Number(res.data.total) || 0;
this.flag = true;
} else {
uni.showToast({
title: res.msg || "运费计算失败",
icon: "none",
});
this.flag = true;
}
})
.catch((err) => {
console.error("运费计算错误:", err);
this.flag = true;
});
}, },
// //
@ -946,7 +970,7 @@ export default {
expectedAmount: this.allprice, expectedAmount: this.allprice,
usePoints: this.usePoints ? 0 : 1, // 使 usePoints: this.usePoints ? 0 : 1, // 使
pointsQuantity: parseInt(this.usePoints) || 0, // 使 pointsQuantity: parseInt(this.usePoints) || 0, // 使
shippingFee: 0, shippingFee: this.post || 0, // 使
}; };
this.Post( this.Post(
@ -965,13 +989,13 @@ export default {
interval: 2000, interval: 2000,
onSuccess: (data) => { onSuccess: (data) => {
this.isOrderLoading = false; // this.isOrderLoading = false; //
this.getTotalPoints(); this.getTotalPoints();
// //
// uni.showToast({ // uni.showToast({
// title: "", // title: "",
// icon: "success", // icon: "success",
// }); // });
this.orderPay(res.msg) this.orderPay(res.msg);
}, },
onFailure: (data) => { onFailure: (data) => {
this.isOrderLoading = false; // this.isOrderLoading = false; //
@ -1006,36 +1030,36 @@ export default {
}); });
}); });
}, },
orderPay(token){ orderPay(token) {
this.Post( this.Post(
{ {
method: "POST", method: "POST",
orderNo:token, orderNo: token,
fromType:1, fromType: 1,
payAmount:this.allprice, payAmount: this.allprice,
}, },
"/framework/wxPay/submitShopPurOrder", "/framework/wxPay/submitShopPurOrder",
"DES" "DES"
).then(res =>{ ).then((res) => {
uni.requestPayment({ uni.requestPayment({
nonceStr: res.data.wxInfo.nonceStr, nonceStr: res.data.wxInfo.nonceStr,
package: res.data.wxInfo.package, package: res.data.wxInfo.package,
paySign: res.data.wxInfo.paySign, paySign: res.data.wxInfo.paySign,
signType: res.data.wxInfo.signType, signType: res.data.wxInfo.signType,
timeStamp: res.data.wxInfo.timeStamp, timeStamp: res.data.wxInfo.timeStamp,
success: () => { success: () => {
uni.redirectTo({ uni.redirectTo({
url:'/subPackages/haveFeeling/list' url: "/subPackages/haveFeeling/list",
}) });
}, },
fail() { fail() {
uni.redirectTo({ uni.redirectTo({
url:'/subPackages/haveFeeling/list' url: "/subPackages/haveFeeling/list",
}) });
} },
}); });
}) });
}, },
// -------------------------------------- // --------------------------------------
changPopShow(e) { changPopShow(e) {

Loading…
Cancel
Save