页面
Some checks failed
Auto Merge Main to Other Branches / Merge main into i18n (push) Has been cancelled
Auto Merge Main to Other Branches / Merge main into base-sard-ui (push) Has been cancelled

This commit is contained in:
sjeam 2025-08-31 10:07:26 +08:00
commit 412073a9fb
12 changed files with 51 additions and 31 deletions

5
env/.env vendored
View File

@ -2,7 +2,7 @@ VITE_APP_TITLE = 'unibest'
VITE_APP_PORT = 9000 VITE_APP_PORT = 9000
VITE_UNI_APPID = '__UNI__D1E5001' VITE_UNI_APPID = '__UNI__D1E5001'
VITE_WX_APPID = 'wxe2428e8fe6767e45' VITE_WX_APPID = 'wxdee751952c8c2027'
# h5部署网站的base配置到 manifest.config.ts 里的 h5.router.base # h5部署网站的base配置到 manifest.config.ts 里的 h5.router.base
VITE_APP_PUBLIC_BASE=/ VITE_APP_PUBLIC_BASE=/
@ -13,7 +13,8 @@ VITE_LOGIN_URL = '/pages/login/index'
VITE_SERVER_BASEURL = 'https://test.shop.lihaink.cn/' VITE_SERVER_BASEURL = 'https://test.shop.lihaink.cn/'
VITE_UPLOAD_BASEURL = 'https://test.shop.lihaink.cn//upload' VITE_UPLOAD_BASEURL = 'https://test.shop.lihaink.cn//upload'
VITE_CRMEB_SERVER_BASEURL = 'https://shop.lihaink.cn'
VITE_CRMEB_SERVER_BASEURL = 'https://test.shop.lihaink.cn/pages/user/login'
# 有些同学可能需要在微信小程序里面根据 develop、trial、release 分别设置上传地址,参考代码如下。 # 有些同学可能需要在微信小程序里面根据 develop、trial、release 分别设置上传地址,参考代码如下。
# 下面的变量如果没有设置,会默认使用 VITE_SERVER_BASEURL or VITE_UPLOAD_BASEURL # 下面的变量如果没有设置,会默认使用 VITE_SERVER_BASEURL or VITE_UPLOAD_BASEURL

View File

@ -1,4 +1,10 @@
import type { ICaptcha, IUpdateInfo, IUpdatePassword, IUserInfoVo, IUserLogin } from './login.typings' import type {
ICaptcha,
IUpdateInfo,
IUpdatePassword,
IUserInfoVo,
IUserLogin,
} from './login.typings'
import { http } from '@/utils/http' import { http } from '@/utils/http'
/** /**
@ -63,8 +69,8 @@ export function getWxCode() {
return new Promise<UniApp.LoginRes>((resolve, reject) => { return new Promise<UniApp.LoginRes>((resolve, reject) => {
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: res => resolve(res), success: (res) => resolve(res),
fail: err => reject(new Error(err)), fail: (err) => reject(new Error(err)),
}) })
}) })
} }
@ -79,5 +85,10 @@ export function getWxCode() {
* @returns Promise * @returns Promise
*/ */
export function wxLogin(data: { code: string }) { export function wxLogin(data: { code: string }) {
return http.post<IUserLogin>('/user/wxLogin', data) // return http.post<IUserLogin>('/user/wxLogin', data)
return http.post('/api/auth/routineLogin', data)
} }
// export function routineLoginApi(data: { code: string }) {
// return http.post('/api/auth/routineLogin', data)
// }

View File

@ -98,8 +98,8 @@ const onSubmit = () => {
emit('update:modelValue', false) emit('update:modelValue', false)
console.log('保存用户信息') console.log('保存用户信息')
userStore.setUserInfo({ nickname: nickname.value, avatar: avatarUrl.value }) // userStore.setUserInfo({ nickname: nickname.value, avatar: avatarUrl.value })
// userStore.wxLogin() userStore.wxLogin()
} }
</script> </script>

View File

@ -83,7 +83,7 @@
}, },
"quickapp": {}, "quickapp": {},
"mp-weixin": { "mp-weixin": {
"appid": "wxe2428e8fe6767e45", "appid": "wxdee751952c8c2027",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,

View File

@ -188,7 +188,7 @@ function goToShop() {
// if (this.isLogin) { // if (this.isLogin) {
let urls = 'https://shop.lihaink.cn/' let urls = 'https://shop.lihaink.cn/'
uni.navigateTo({ uni.navigateTo({
url: `/pages/web_view/index?local_url=${urls}&title=区域特产`, url: `/pages/web_view/index?target=${urls}&title=区域特产`,
}) })
// } else { // } else {
// this.openAuto() // this.openAuto()

View File

@ -361,7 +361,7 @@ function goToShop() {
// if (this.isLogin) { // if (this.isLogin) {
let urls = 'https://shop.lihaink.cn/' let urls = 'https://shop.lihaink.cn/'
uni.navigateTo({ uni.navigateTo({
url: `/pages/web_view/index?local_url=${urls}&title=区域特产`, url: `/pages/web_view/index?target=${urls}&title=区域特产`,
}) })
// } else { // } else {
// this.openAuto() // this.openAuto()

View File

@ -105,15 +105,15 @@
<view <view
class="p-1" class="p-1"
style="display: inline-block; width: 300rpx" style="display: inline-block; width: 300rpx"
@click="goToShop('https://shop.lihaink.cn/')" @click="goToShop()"
v-for="item in product_30.list" v-for="item in product_30.list"
> >
<wd-card custom-class="card-content"> <wd-card custom-class="card-content">
<view style="height: 200rpx"> <view style="height: 200rpx; width: 300rpx">
<wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.image" /> <wd-img radius="20rpx" :width="'100%'" :height="'100%'" :src="item.image" />
</view> </view>
<view class="ps-2 pt-2 font-size-4 font-bold">{{ item.store_name }}</view> <view class="ps-2 pt-2 font-size-4 font-bold">{{ item.store_name }}</view>
<view class="ps-2 pt-2 font-size-3">我们这里的食物很新鲜</view> <view class="ps-2 pt-2 font-size-3 ellipsis">{{ item.store_info }}</view>
<view class="ps-2 pt-2 pb-2"> <view class="ps-2 pt-2 pb-2">
<view class="text-sm text-gray-500 text-left"> <view class="text-sm text-gray-500 text-left">
<wd-text size="20rpx" color="red" :text="item.price" mode="price" prefix="¥" /> <wd-text size="20rpx" color="red" :text="item.price" mode="price" prefix="¥" />
@ -121,7 +121,7 @@
<wd-text <wd-text
size="18rpx" size="18rpx"
color="gray" color="gray"
:text="item.line_price" :text="item.ot_price"
mode="price" mode="price"
decoration="line-through" decoration="line-through"
prefix="¥" prefix="¥"
@ -430,7 +430,7 @@
<script lang="ts" setup> <script lang="ts" setup>
// import { toLogin } from '@/libs/login.js' // import { toLogin } from '@/libs/login.js'
import { getProductAPI } from '@/service/crmeb/product' import { getProductAPI } from '@/service/crmeb/product.ts'
onLoad(() => { onLoad(() => {
getProduct(30) getProduct(30)
@ -476,7 +476,7 @@ function moreTourism() {
} }
function more(item) { function more(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/web_view/index?local_url=${item.url}&title=${item.name}`, url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
}) })
} }
// function more() { // function more() {
@ -487,9 +487,11 @@ function more(item) {
// } // }
function goToShop() { function goToShop() {
// if (this.isLogin) { // if (this.isLogin) {
let urls = ' ' // const target = encodeURIComponent('/pages/goods_cate/goods_cate')
const target = '/pages/goods_cate/goods_cate'
// let urls = 'https://test.shop.lihaink.cn/pages/user/login'
uni.navigateTo({ uni.navigateTo({
url: `/pages/web_view/index?local_url=${urls}&title=区域特产`, url: `/pages/web_view/index?target=${target}&title=区域特产`,
}) })
// } else { // } else {
// this.openAuto() // this.openAuto()

View File

@ -5,8 +5,8 @@
</route> </route>
<template> <template>
<view class=" "> <view class="background_home">
<view class=" " style=""> <view class="p-4" style="">
<wd-card custom-class="card-content"> <wd-card custom-class="card-content">
<view class="relative" style="height: 380rpx"> <view class="relative" style="height: 380rpx">
<wd-img <wd-img

View File

@ -4,7 +4,7 @@
} }
</route> </route>
<template> <template>
<view class="background_home"> <view>
<wx-login /> <wx-login />
<!-- <view class="ml-4">wx的openid:</view> --> <!-- <view class="ml-4">wx的openid:</view> -->
<!-- <view class="ml-4">{{ openId }}</view> --> <!-- <view class="ml-4">{{ openId }}</view> -->
@ -67,8 +67,8 @@ uni.login({
provider: 'weixin', provider: 'weixin',
success: async ({ code }) => { success: async ({ code }) => {
const res = await http<{ session_key: string; openid: string }>({ const res = await http<{ session_key: string; openid: string }>({
method: 'GET', method: 'POST',
url: '/weixin/jscode2session', url: '/api/auth/routineLogin',
data: { data: {
code, code,
}, },

View File

@ -23,7 +23,7 @@ const { safeAreaInsets } = uni.getSystemInfoSync()
// console.log('about') // console.log('about')
function more(item) { function more(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/web_view/index?local_url=${item.url}&title=${item.name}`, url: `/pages/web_view/index?target=${item.url}&title=${item.name}`,
}) })
} }
</script> </script>

View File

@ -44,7 +44,10 @@ export default defineComponent({
}, },
}, },
onLoad(option) { onLoad(option) {
this.local_url = decodeURIComponent(getUrlCrmeb() + option.local_url) // this.local_url = decodeURIComponent(getUrlCrmeb() + option.target)
console.log(getUrlCrmeb())
const target = encodeURIComponent(option.target)
this.local_url = getUrlCrmeb() + '?target=' + target
this.title = option.title || '' this.title = option.title || ''
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.title, // title: this.title, //

View File

@ -52,7 +52,9 @@ page {
// .text-shadow { // .text-shadow {
// text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); // text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
// } // }
.scroll-view-container::-webkit-scrollbar {
display: none;
}
.scroll-view-container { .scroll-view-container {
white-space: nowrap; // 防止内容换行 white-space: nowrap; // 防止内容换行
// padding: 20rpx; // padding: 20rpx;
@ -118,10 +120,13 @@ page {
font-size: 12px; font-size: 12px;
} }
//文字换行
$container-width: 100%;
$padding-width: 20rpx;
.ellipsis { .ellipsis {
display: inline-block; display: inline-block;
/* 在末尾显示省略号 */
width: calc(100vw - 340rpx); width: calc($container-width - $padding-width); /* 确保容器有宽度 */
/* 防止文字换行 */ /* 防止文字换行 */
overflow: hidden; overflow: hidden;
/* 隐藏超出部分的文字 */ /* 隐藏超出部分的文字 */
@ -129,8 +134,6 @@ page {
white-space: nowrap; white-space: nowrap;
/* 确保元素有宽度 */ /* 确保元素有宽度 */
} }
$container-width: 100vw;
$padding-width: 0rpx;
.ellipsis-2 { .ellipsis-2 {
display: -webkit-box; display: -webkit-box;
font-weight: 500; font-weight: 500;