1 Star 0 Fork 2

落地 / 商城源码

forked from coyeking / 商城源码 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
App.vue 13.92 KB
一键复制 编辑 原始数据 按行查看 历史
coyeking 提交于 2021-04-10 23:40 . 1
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716
<script>
// 引入检查更新模块
import { checkUpdater } from '@/common/checkUpdater'
import Vue from 'vue'
export default {
onLaunch: function () {
// console.log('App Launch')
// app打开时先检查是否有更新记录(更新记录会被保存在storage中)
// 更新记录的内容为 { 更新标记, 安装包位置 }
// 如果存在更新记录,且更新标记(complete=true)则删除上次使用过的安装包,达到存储释放空间的目的
// 如果存在更新记录,且更新标记(complete=false)则进行安装更新 - 2019年3月27日 新增强制更新内容
// #ifdef APP-PLUS
plus.screen.lockOrientation('portrait-primary') //竖屏正方向锁定
const updated = uni.getStorageSync('updated') // 尝试读取storage
if (updated.completed === true) { // 如果上次刚更新过
// 删除安装包及安装记录
console.log('安装记录被删除,更新成功')
uni.removeSavedFile({
filePath: updated.packgePath,
success: (res) => {
uni.removeStorageSync('updated')
}
})
} else if (updated.completed === false) {
uni.removeStorageSync('updated')
plus.runtime.install(updated.packgePath, { force: true })
uni.setStorage({
key: 'updated',
data: {
completed: true,
packgePath: updated.packgePath
},
success: (res) => {
console.log('成功安装上次的更新,应用需要重启才能继续完成')
}
})
uni.showModal({
title: '提示',
content: '应用将重启以完成更新',
showCancel: false,
complete: () => {
plus.runtime.restart()
}
})
} else {
// 检查更新,参数:{ 当前版本号,跳转到更新页面的url11 }
checkUpdater(this.$current.id, '/pages/updataAPP/updataAPP',this.siteInfo.wxapp_id)
}
// #endif
uni.getSystemInfo({
success: function(e) {
Vue.prototype.StatusBar = e.statusBarHeight;
// #ifndef MP
Vue.prototype._platform = e.platform
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
}
})
},
// onShow: function () {
// console.log('App Show')
// },
// onHide: function () {
// console.log('App Hide')
// }
}
</script>
<style>
/* common.wxss */
@import url("/utils/common.scss");
page {
background: #f7f7f7;
}
.common-header-xian {
border-top: 1upx solid #eee;
position: fixed;
top: 0;
width: 100%;
z-index: 100;
}
.del {
text-decoration: line-through;
padding-left: 10upx;
color: #999;
}
/* 没有更多 */
.no-more {
text-align: center;
color: #737373;
padding: 10px 0;
}
.yoshop-notcont {
padding: 130upx 100upx;
box-sizing: border-box;
}
.yoshop-notcont .cont {
display: block;
text-align: center;
font-size: 30upx;
color: #999;
margin-top: 10upx;
}
.yoshop-notcont .iconfont {
font-size: 150upx;
color: #ccc;
text-align: center;
display: block;
margin-bottom: 12upx;
}
.yoshop-notcont .img {
width: 200px;
height: 120px;
margin: 0 auto;
}
.yoshop-notcont .img image {
width: 100%;
height: 100%;
}
.yoshop-notcont .jump {
display: block;
margin: auto;
margin-top: 20upx;
width: 180upx;
line-height: 60upx;
color: #fff;
background: #ff5c5c;
border-radius: 10upx;
text-align: center;
font-size: 30upx;
}
.bargain-commont-bg {
background: rgba(0, 0, 0, 0.6);
position: fixed;
right: 0;
left: 0;
top: 0;
bottom: 0;
z-index: 20;
}
.selectNumber {
height: 52upx;
flex-direction: row;
border: 1upx solid rgb(231, 231, 231);
border-radius: 5upx;
display: inline-block;
}
.selectNumber .default {
width: 60upx;
height: 52upx;
float: left;
line-height: 48upx;
padding: 0;
background: #fff;
color: #444;
font-size: 40upx;
border-radius: unset;
}
.selectNumber .default-active {
background: #fbfbfb;
color: #ddd;
}
.selectNumber button:after {
content: none;
border: none;
}
.selectNumber input {
float: left;
width: 40px;
height: 26px;
line-height: 26px;
border-right: 1upx solid #eee;
border-left: 1upx solid #eee;
text-align: center;
font-size: 28upx;
color: #444;
}
/* 返回顶部 */
.widget-goTop {
position: fixed;
bottom: 150upx;
z-index: 10;
right: 24upx;
background: rgba(255, 255, 255, 0.9);
width: 76upx;
height: 76upx;
border-radius: 76upx;
border: 1upx solid #eee;
}
.widget-goTop .icon-fanhuidingbu {
color: #666;
display: block;
text-align: center;
line-height: 76upx;
font-size: 32upx;
}
@-webkit-keyframes rotate {
0% {
transform: rotate(0deg) scale(1);
}
100% {
transform: rotate(360deg) scale(1);
}
}
@keyframes rotate {
0% {
transform: rotate(0deg) scale(1);
}
100% {
transform: rotate(360deg) scale(1);
}
}
/* 底线 */
.title-footer {
position: relative;
z-index: 1;
height: 80upx;
line-height: 80upx;
overflow: hidden;
color: #888;
text-align: center;
margin: 0 18upx 0;
}
.title-footer .cont {
background: #f7f7f7;
padding: 0 12upx;
font-size: 28upx;
z-index: 10;
}
.title-footer .hr {
background: #eee;
height: 1upx;
border: 0;
position: absolute;
left: 10%;
right: 10%;
top: 50%;
margin-top: 1px;
z-index: -1;
}
.slide-image {
width: 100%;
height: 100%;
margin: 0 auto;
display: block;
}
.goods-comment-box .user {
margin-right: 15upx;
}
.goods-comment-box .user_name {
color: #999;
}
.goods-comment-cont {
font-size: 30upx;
color: #333;
margin: 10upx 0;
}
/* 底部操作栏 */
.footer-fixed {
position: fixed;
bottom: 0px;
left: 0px;
right: 0px;
display: flex;
height: 92upx;
z-index: 11;
box-shadow: 0 -2px 20px 0 rgba(144, 52, 52, 0.1);
background: #fff;
}
/* 底部操作按钮 */
.footer-fixed .opt-btn {
display: flex;
text-align: center;
font-size: 30upx;
width: 100%;
height: 100%;
justify-content: center;
align-items: center;
}
.footer-fixed .opt-btn.btn-main {
background-image: linear-gradient(90deg, #ff387f, #ff2e34);
color: #fff;
}
.footer-fixed .opt-btn.btn-gray {
background-color: #ccc;
color: #fff;
}
/* 废弃 */
.order-bt {
width: 50%;
/* background: linear-gradient(to right, #fa1e8c 0, #fc1e56 100%); */
background-image: linear-gradient(90deg, #ff387f, #ff2e34);
color: #fff;
text-align: center;
line-height: 92upx;
font-size: 30upx;
}
.goods-detail-box {
padding: 0;
min-height: 150px;
}
.com_xing .icon-shoucang {
padding-right: 6upx;
color: #ccc;
font-size: 26upx;
}
.com_xing .icon-shoucang.active {
color: #f4a213;
}
.goods-comment-box .left {
flex: 3;
position: relative;
}
.goods-comment-box .right {
flex: 3;
}
.v-hide {
display: none !important;
}
.v-show {
display: block !important;
}
.flow-checkout-header {
padding: 28upx 0;
background: #fff url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANYAAAANCAYAAADVGpDCAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ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mOmRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo1OTRiYzUyMy1jMzc3LTExNzgtYTdkZS04NGY3YmM1ZGIxMDMiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz556PLxAAACBElEQVR42tyaSyhEYRTHP48imlKibDQeSSlkSlEWLCRFsZNH5FE2FqQ8ErIRC9lIkTwXSpMkWWChhEJCSnlkoUZGSsr78f98n43CMFPu/Z/6NZuZ2zn33/+cb869XkmLx8IDEQaGQJbgiytQDSY3MyL+LYnL/HxPXSoHDIJQQq2WQQk4Dbbb/yUB29LJ+6e3B66VB3ZITbUIEqSpCGoJBP1ghtBUD6ARpEtTGSEhXzd+awE9oJzQUPegWdf3QlBPMhgDMYRa7YNisGWkpP5qrBQtVBShUHugUE9hs4fUtwG0utlEjRivoA/Ug1sj3vjffr8FNJEK1auPFHcE9UTq5pdK2PwcoAzMG7mjuRrRYEIfK9jiDJSCBZJ6ynSTsBBqNQ0qgdPISbq6vJCFbJOaagrEk5gqWNczRGiqG1Ah1LLMafRkf5pYIUKtZnMJDXUNasAIST2ZYFioRx9ssQaKwJFZEv5uYmWDXVJTrYBEElP562PfPKGpnkAbSDOTqb6aWAGgW6iHol5kQj2CdtAJngnqkc1hHMQRNr9DPaXWzZj8Z2PZtFCxhEIdaKE2CGqRJ4060AH8CLUaALX6f5VpBZLhI9SaeZXQVHKNLt84SCIxVbhQi5YuQlNd6OVElZlN9TGxrGBUn2PZ4lyoTdIsST0FQj0UDSLUak6ot3gcBLVY3wQYAJoVXxmNERajAAAAAElFTkSuQmCC') bottom left repeat-x;
background-size: 120upx auto;
position: relative;
}
.flow-header-left {
/* flex: 14; */
}
.flow-header-right {
flex: 1;
}
.flow-header-right image {
width: 34upx;
height: 34upx;
margin-top: 20upx;
float: right;
}
.flow-checkout-header .flow-checkout-address {
color: #777;
margin-top: 6upx;
}
.flow-shopList {
padding: 18upx 0;
}
.flow-shopList .flow-list-left {
margin-right: 20upx;
}
.flow-shopList .flow-list-left image {
width: 200upx;
height: 200upx;
border: 1upx solid #eee;
background: #fff;
}
.flow-shopList .flow-list-right .flow-cont {
font-size: 28upx;
color: #ff495e;
}
.flow-shopList .flow-list-right .small {
font-size: 26upx;
color: #777;
}
.flow-shopList .flow-list-right .flow-list-cont {
padding-top: 10upx;
}
.flow-fixed-footer {
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
border-top: 1px solid #eee;
z-index: 11;
}
/* 共几件商品 */
.flow-num-box {
font-size: 28upx;
color: #777;
padding: 16upx 24upx;
text-align: right;
}
.flow-all-money {
padding: 0 24upx;
color: #444;
}
.flow-all-money .flow-all-list {
font-size: 28upx;
padding: 20upx 0;
border-bottom: 1upx solid rgb(248, 248, 248);
}
.flow-all-money .flow-all-list:last-child {
border-bottom: none;
}
.flow-all-money .flow-all-list-cont {
font-size: 28upx;
padding: 10upx 0;
}
.flow-all-money .flow-arrow {
justify-content: flex-end;
align-items: center;
}
.flow-fixed-footer .chackout-left {
font-size: 30upx;
line-height: 92upx;
color: #777;
flex: 4;
padding-left: 12px;
}
.flow-fixed-footer .chackout-right {
font-size: 34upx;
flex: 2;
}
.flow-btn {
background: linear-gradient(to right, #fa1e8c 0, #fc1e56 100%);
color: #fff;
text-align: center;
line-height: 92upx;
display: block;
font-size: 30upx;
}
.flow-list .header .shop_name {
padding-left: 10upx;
font-size: 30upx;
color: #333;
}
.flow-list .header image {
width: 34upx;
height: 37upx;
position: absolute;
top: 50%;
margin-top: -18upx;
left: 15px;
}
.flow-list .header {
background: #fdf9f9;
padding: 24upx 0;
border-top: 1upx solid #eee;
border-bottom: 1upx solid #eee;
font-size: 30upx;
position: relative;
}
.flow-list custom-li,
.addres-list custom-li {
margin-top: 25upx;
display: block;
}
.flow-list custom-li:first-child,
.addres-list custom-li:first-child {
margin-top: 0;
}
.flow-distribution-right .icon-xiangyoujiantou {
font-size: 26upx;
position: absolute;
right: 15px;
top: 50%;
margin-top: -16upx;
color: #999;
}
.flow-checkout-address text {
padding-right: 5upx;
}
.flow-header-right .icon-xiangyoujiantou {
position: absolute;
right: 15px;
top: 50%;
margin-top: -13upx;
font-size: 32upx;
color: #999;
}
.flow-shopList .flow-list-left image {
width: 180upx;
height: 180upx;
}
.profile-btn button {
background: linear-gradient(to right, #fa1e8c 0, #fc1e56 100%);
color: white;
margin-bottom: 20upx;
}
.flow-checkout-header .icon-dingwei {
position: absolute;
top: 50%;
left: 15px;
font-size: 40upx;
color: #777;
margin-top: -20upx;
}
.index-cont-search {
width: 100%;
font-size: 28upx;
position: relative;
background: #f7f7f7;
}
.index-cont-search icon {
position: absolute;
left: 50%;
margin-left: -70upx;
top: 50%;
margin-top: -15upx;
}
.index-cont-search text {
margin-left: 72upx;
}
@-webkit-keyframes shop {
0% {
transform: translateY(-80px);
}
50% {
transform: translateY(0px);
}
100% {
transform: translateY(-80px);
}
}
@keyframes shop {
0% {
transform: translateY(-80px);
}
50% {
transform: translateY(0px);
}
100% {
transform: translateY(-80px);
}
}
.user-orderJtou {
color: #777;
font-size: 26upx;
}
.address-box .left-name {
width: 95px;
}
.address-box .right-cont {
font-size: 30upx;
color: #444;
}
.address-box .right-cont input {
width: 100%;
font-size: 30upx;
color: #444;
}
.address-cont-box picker {
display: inline-block;
margin-right: 15px;
width: 100%;
}
.button {
border: 1px solid #1aad19;
border-radius: 2px;
}
.picker {
padding: 13px;
background-color: #fff;
}
.profile-list {
padding: 24upx 0;
border-bottom: 1px solid #f6f6f9;
}
.profile-list .admin {
font-size: 30upx;
color: #333;
}
.profile-btn button {
font-size: 34upx;
}
.profile-btn button[disabled] {
background: #f16474;
color: white;
}
.btn-green button {
background: #1aad19;
color: white;
}
.btn-green button[disabled] {
background: #9de49c;
color: white;
}
.search-box .left {
width: 28px;
}
.search-box .left icon {
padding: 18upx;
}
.search-box .right {
flex: 1;
}
.xEmojiView {
margin: 15upx 0;
}
</style>
1
https://gitee.com/locdee/mall-source-code.git
git@gitee.com:locdee/mall-source-code.git
locdee
mall-source-code
商城源码
master

搜索帮助