王文杰 7 months ago
parent 8254f569ed
commit cb24d7968a

@ -1,4 +1,12 @@
#!/usr/bin/env sh
###
# @Author: 王文杰
# @Date: 2024-03-22 09:08:28
# @LastEditors: 王文杰
# @LastEditTime: 2024-03-22 10:54:07
# @FilePath: /app-nx-personal/deploy.sh
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
###
# 确保脚本抛出遇到的错误
set -e
@ -11,22 +19,22 @@ git push git@github.com:xxx.git master:master
# 2. 打包生成静态文件
# npm run build:h5
# 注意:项目使用了 uniClound需在 HbuilderX 打包 H5 网站,否则无法使用云功能
cli publish --platform h5 --project erabbit-uni-app --spaceId mp-2fac390c-2ea7-4d12-9726-f5b9a3bb6c37
cli publish --platform h5 --project uni-app --spaceId mp-2fac390c-2ea7-4d12-9726-f5b9a3bb6c37
# 3. 生成流水线.yml
mkdir -p "./dist/build/h5/.github/workflows"
cp "./deploy.yml" "./dist/build/h5/.github/workflows/deploy.yml"
# 4. 进入生成的文件夹,提交到主仓库 gh-pages 分支
# 4. 进入生成的文件夹,提交到主仓库 app-nx-personal 分支
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
cd dist/build/h5
git init -b master
git add -A
git commit -m 'deploy: gh-pages'
git commit -m 'deploy: app-nx-personal'
# 如果发布到 https://<USERNAME>.github.io/<REPO>
# git push -f git@gitee.com:<USERNAME>/<REPO>.git master:gh-pages
git push -f git@github.com:xxx.git master:gh-pages
git push -f git@github.com:xxx.git master:app-nx-personal
cd -

959
package-lock.json generated

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,15 @@
<!--
* @Author: 王文杰
* @Date: 2024-03-22 09:14:06
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-22 10:53:09
* @FilePath: /app-nx-personal/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!--
* @Author: 王文杰
* @Date: 2024-01-04 12:54:56
* @LastEditors: 王文杰
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-15 17:32:13
* @FilePath: /app-nx-personal/src/App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE

@ -12,7 +12,6 @@ export function createApp() {
// 使用 pinia
app.use(pinia)
return {
app,
}

@ -18,6 +18,7 @@ const addressList = ref<any[]>([])
const activeIndex = ref(0)
const handleChange = (e) => {
activeIndex.value = e.currentTarget.dataset.val
handleClose()
}
const handleClose = () => {

@ -1,14 +1,14 @@
<!--
* @Author: 王文杰
* @Date: 2024-03-04 14:13:16
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-15 15:58:50
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-22 11:51:04
* @FilePath: /app-nx-personal/src/pages/index/components/CategoryPanel.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import type { CategoryItem } from '@/types/home'
import { categoryListDefault } from '@/services/constants'
// props
defineProps<{
list: Object[]

@ -9,27 +9,18 @@ import PageSkeleton from './components/PageSkeleton.vue'
import PhoneContact from './components/PhoneContact.vue'
import NeighborhoodSite from './components/NeighborhoodSite.vue'
import { getHomeCategoryAPI, getNearbySiteAPI } from '@/services/home'
import { serviceDomain } from '@/services/constants'
import { serviceDomain, bannerList, categoryListDefault } from '@/services/constants'
import { useCategoryStore } from '@/stores/modules/category'
const memberStore = useMemberStore()
const categoryStore = useCategoryStore()
//
const bannerList = reactive<BannerItem[]>([
{
id: '1',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1013001',
type: '1',
},
{
id: '2',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1019000',
type: '1',
},
])
const isLogin = computed(() => {
const token = memberStore.profile?.token
const storage_token = uni.getStorageSync('storage_userInfo')?.token
return !!token || !!storage_token
})
//
const categoryList = ref<CategoryItem[]>([])
let siteList = reactive([])
@ -38,27 +29,24 @@ let location = reactive({
longitude: 0,
latitude: 0,
})
const isLogin = computed(() => {
const token = memberStore.profile?.token
const storage_token = uni.getStorageSync('storage_userInfo')?.token
return !!token || !!storage_token
})
//
const isLoading = ref(false)
const isUpdate = ref(true)
//
onShow(async () => {
// getHomeCategory()
if (isLogin.value) {
getSettingInfo()
} else {
uni.navigateTo({ url: '/pages/login/login' })
categoryList.value = categoryListDefault
}
})
const init = async () => {
isLoading.value = true
await getHomeCategory()
await getHomeSite()
isUpdate.value = false
// await Promise.all([getHomeCategory(), getHomeSite()])
isLoading.value = false
}
@ -66,16 +54,14 @@ const init = async () => {
const getHomeCategory = async () => {
const params = {}
const res = await getHomeCategoryAPI(params)
if (res.code == 200) {
res.data.forEach((e) => {
const arr = e.photo && JSON.parse(e.photo) || []
const obj2 = arr[0]
const imgUrl = serviceDomain + obj2?.url
e.imgUrl = imgUrl
})
categoryList.value = res.data
categoryStore.changeSelectedCategory(res.data)
}
res.data.forEach((e) => {
const arr = e.photo && JSON.parse(e.photo) || []
const obj2 = arr[0]
const imgUrl = serviceDomain + obj2?.url
e.imgUrl = imgUrl
})
categoryList.value = res.data
categoryStore.changeSelectedCategory(res.data)
}
const getHomeSite = async () => {
//
@ -110,7 +96,7 @@ const getLocationInfo = () => {
latitude: latitude,
})
uni.setStorageSync('location', location)
if (!categoryList.value.length) {
if (isUpdate.value) {
init()
}
},

@ -1,5 +1,6 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { postListSiteAPI } from '@/services/site'
import { serviceDomain } from '@/services/constants'
import SiteItem from './components/siteItem.vue'
@ -13,12 +14,10 @@ type siteParams = {
pageSize: Number
}
//
const locationStorge = uni.getStorageSync('location')
//
const queryParams: Required<siteParams> = {
pageNo: 1,
pageSize: 10,
location: locationStorge,
}
//
const dataList = ref<any[]>([])
@ -37,28 +36,32 @@ const getDataList = async () => {
//
isLoading.value = true
//
const res = await postListSiteAPI(queryParams)
//
isLoading.value = false
if (res.data.list.length) {
res.data.list.forEach((e) => {
// e.distance = e.distance / 1000 + 'Km'
const arr = JSON.parse(e.stationImg)
const imgUrl = serviceDomain + arr[0].url
e.imgUrl = imgUrl
const categoryArr = e.stationProducts?.map((q) => q.name) || []
e.categoryStr = categoryArr.join('.')
})
//
dataList.value.push(...res.data.list)
}
//
if (queryParams.pageNo < res.data.pages) {
//
queryParams.pageNo++
} else {
//
isFinish.value = true
try {
const res = await postListSiteAPI(queryParams)
//
isLoading.value = false
if (res.data.list.length) {
res.data.list.forEach((e) => {
// e.distance = e.distance / 1000 + 'Km'
const arr = JSON.parse(e.stationImg)
const imgUrl = serviceDomain + arr[0].url
e.imgUrl = imgUrl
const categoryArr = e.stationProducts?.map((q) => q.name) || []
e.categoryStr = categoryArr.join('.')
})
//
dataList.value.push(...res.data.list)
}
//
if (queryParams.pageNo < res.data.pages) {
//
queryParams.pageNo++
} else {
//
isFinish.value = true
}
} catch (error) {
isLoading.value = false
}
}
const isTriggered = ref(false)
@ -75,7 +78,11 @@ const onRefresherrefresh = async () => {
//
isTriggered.value = false
}
getDataList()
onShow(() => {
const locationStorge = uni.getStorageSync('location')
queryParams.location = locationStorge
getDataList()
})
</script>
<template>
<view class="service-site">
@ -134,4 +141,4 @@ page {
.toolbar-height {
height: 100rpx;
}
</style>
</style>, onShow

@ -2,44 +2,9 @@
import { ref, reactive } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import { getSiteDetailAPI } from '@/services/site'
import { serviceDomain } from '@/services/constants'
import { serviceDomain, bannerList } from '@/services/constants'
import PageSkeleton from './components/PageSkeleton.vue'
const leiList = [
{
id: 1,
name: '旧衣服',
},
{
id: 2,
name: '家用电器',
},
{
id: 2,
name: '废纸废书',
},
{
id: 3,
name: '废金属',
},
{
id: 4,
name: '废塑料',
},
]
const bannerList = [
{
id: '1',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1013001',
type: '1',
},
{
id: '2',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1019000',
type: '1',
},
]
//
const location = uni.getStorageSync('location')
@ -112,22 +77,12 @@ onLoad((options) => {
<view class="product-price">回收价格{{ item2.recoveryPrice }} </view>
</view>
</view>
<!-- <view
class="item"
@tab="handleMenuChange(index)"
:class="{ active: activeMenuKey == index }"
v-for="(item, index) in leiList"
:key="item.id"
>{{ item.name }}</view
> -->
</view>
<view class="detail-list">
<view class="item flex-row">
<view class="service-title">特色服务</view>
<view class="tag-list">
<view class="tag">再生资源回收</view>
<!-- <view class="tag">家电维修</view>
<view class="tag">品控质检</view> -->
</view>
</view>
<view class="item flex-column rate">

@ -1,8 +1,8 @@
<!--
* @Author: 王文杰
* @Date: 2024-03-14 11:16:28
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-22 09:25:41
* @LastEditors: 王文杰
* @LastEditTime: 2024-03-22 10:52:17
* @FilePath: /app-nx-personal/src/pagesMember/payment/payment.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
@ -41,17 +41,27 @@ const handleSelected = (e) => {
const handleSubmit = async () => {
// 退
if (isLoading.value) return
const amount = moneyList[activeIndex.value].val
const params = {
amount,
}
isLoading.value = true
const res = await getDrawCashAPI(params)
isLoading.value = false
uni.showToast({ icon: 'none', title: '提现成功' })
const url = `/pages/my/my`
uni.switchTab({ url })
//
uni.showModal({
content: '是否提现',
confirmColor: '#3775F6',
success: async (res) => {
if (res.confirm) {
const amount = moneyList[activeIndex.value].val
const params = {
amount,
}
isLoading.value = true
const res = await getDrawCashAPI(params)
isLoading.value = false
uni.showToast({ icon: 'none', title: '提现成功' })
setTimeout(() => {
const url = `/pages/my/my`
uni.switchTab({ url })
}, 500)
}
},
})
}
const handleDetail = () => {
const url = `/pagesMember/payment-detail/payment-detail`

@ -2,7 +2,7 @@
* @Author:
* @Date: 2024-01-04 12:54:56
* @LastEditors:
* @LastEditTime: 2024-03-22 09:37:01
* @LastEditTime: 2024-03-22 11:16:46
* @FilePath: /app-nx-personal/src/services/constants.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -35,6 +35,89 @@ export const weightMenuList = [
name: '20Kg以上',
},
]
// 获取轮播图数据
export const bannerList = [
{
id: '1',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1013001',
type: '1',
},
{
id: '2',
imgUrl: '/static/images/banner1.jpg',
hrefUrl: '1019000',
type: '1',
},
]
/** 订单状态列表 */
export const categoryListDefault = [
{
id: '1',
code: 'SPHS2024031700019',
name: '旧衣服',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/6e946650966a4d741dfdf5b9159d9b81.png',
},
{
id: '2',
code: '旧衣服回收不浪费',
name: '家用电器',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/6bc7408b70d1a6bfbd6e1073e2e5f477.png',
},
{
id: '3',
code: 'SPHS2024031700016',
name: '废纸废书',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/4cc88d4fcea3c905ed18b0262a597612.png',
},
{
id: '4',
code: 'SPHS2024031700015',
name: '废金属',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/3775f85ee4a06d23a2cc57be2ada03f3.png',
},
{
id: '5',
code: 'SPHS2024031700014',
name: '废塑料',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/d2bf68bb986aed78053d32fd066a3091.png',
},
{
id: '6',
code: 'SPHS2024031700013',
name: '废玻璃',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/0a838dfa3cd0d574a31aa6e8f0537513.png',
},
{
id: '7',
code: 'SPHS2024031700012',
name: '有害垃圾',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/6e8a73123202a5da37e3824031a8af7f.png',
},
{
id: '8',
code: 'SPHS2024031700011',
name: '其他',
desc: '',
weightNum: '',
imgUrl: 'https://nxhs.cjyx.cc/upload/image/406437440626ac2961721cb493b2e45e.png',
},
]
// 文件路径
export const serviceDomain = 'https://nxhs.cjyx.cc'
// export const serviceDomain = 'http://222.71.165.188:8808'

Loading…
Cancel
Save