第一次提交
This commit is contained in:
187
pages/agreement/yhxyPage.vue
Normal file
187
pages/agreement/yhxyPage.vue
Normal file
@@ -0,0 +1,187 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="dp_title">疯子读书软件许可及服务协议</view>
|
||||
<view class="dp_content">
|
||||
<view>导言:</view>
|
||||
<view>欢迎你使用疯子读书软件及服务! </view>
|
||||
<view>为使用疯子读书软件及服务(以下简称“本软件”、“疯子读书服务”或“本服务”),你应当阅读并遵守《疯子读书软件许可及服务协议》(以下简称“本协议”)、以及《会员订阅服务条款》等疯子读书服务的各项制度规范。
|
||||
</view>
|
||||
<view>请你务必审慎阅读、充分理解各条款内容,特别是免除或限制疯子读书责任的相应条款,以及开通或使用某项服务(如无限卡会员订阅服务)的单独协议,并选择接受或不接受。限制、免责条款可能以加粗形式提示你注意。
|
||||
</view>
|
||||
<view>除非你已阅读并接受本协议所有条款,否则你无权下载、安装或使用本软件及相关服务。你的下载、安装、使用、登录等行为即视为你已阅读并同意上述协议的约束。 </view>
|
||||
<view>你有违反本协议的任何行为时,疯子读书有权依照违反情况,随时单方限制、中止或终止向你提供本服务,并有权追究你的相关责任。
|
||||
如果你未满18周岁,请在监护人的陪同下阅读本协议及其他上述协议,并特别注意未成年人使用条款。 </view>
|
||||
<view class="dp_con1">一、【协议的范围】 </view>
|
||||
<view class="dp_con2">1. 本协议是你与疯子读书之间关于你下载、安装、使用、复制本软件,以及使用疯子读书相关服务所订立的协议。</view>
|
||||
<view class="dp_con2">2.
|
||||
本协议被视为《疯子读书服务协议》及《疯子读书微信软件许可及服务协议》的补充协议,是其不可分割的组成部分,与其构成统一整体。本协议与上述内容存在冲突的,以本协议为准。
|
||||
</view>
|
||||
<view class="dp_con2">3. 本协议内容同时包括疯子读书可能不断发布的关于本服务的相关协议、服务声明、业务规则及公告指引等内容(以下统称为“专项规则”)。上述内容一经正式发布,即为本协议不可分割的组成部分,你同样应当遵守。
|
||||
</view>
|
||||
<view class="dp_con1">二、【术语定义】 </view>
|
||||
<view class="dp_con2">1.
|
||||
疯子读书软件:是指疯子读书向用户提供的购买、阅读、赠送、分享电子读物,发布读书想法等服务的客户端软件。你启用本软件后,可以阅读、赠送、分享、评论你通过本服务购买的电子读物,你也可以在你的微信好友允许的情况下,浏览微信好友通过本服务阅读、分享的读物及其读书想法等。
|
||||
</view>
|
||||
<view class="dp_con2">2. 疯子读书:是指天津众妙之门科技有限公司及其相关服务可能存在的运营关联单位。 </view>
|
||||
<view class="dp_con2">3. 用户:是指启用、浏览或上传数据至疯子读书服务的用户,在本协议中也称为“你”。 </view>
|
||||
<view class="dp_con2">4. 其他用户:是指除用户本人外与疯子读书服务相关的其他微信用户。 </view>
|
||||
<view class="dp_con1">三、关于本软件 </view>
|
||||
<view class="dp_con2">1.【服务许可】 </view>
|
||||
<view>本软件可能提供多个应用版本,用户必须选择与所安装设备相匹配的软件版本,各应用版本之间的功能可能不一致,具体以相应版本中展示的为准。用户可根据本协议获得以下许可: </view>
|
||||
<view>1.1 疯子读书给予你一项个人的、不可转让及非排他性的许可,以使用本软件。你可以为非商业目的在单一台终端设备上安装、使用、显示、运行本软件。 </view>
|
||||
<view>1.2 你可以为使用本软件的目的复制本软件的一个副本,仅用作备份。备份副本必须包含原软件中含有的所有著作权信息。 </view>
|
||||
<view>1.3 本条及本协议其他条款未明示授权的其他一切权利仍由疯子读书保留,你在行使这些权利时须另外取得疯子读书的书面许可。疯子读书如果未行使前述任何权利,并不构成对该权利的放弃。 </view>
|
||||
<view class="dp_con2">2.【安装与卸载】 </view>
|
||||
<view>2.1
|
||||
你可以直接从疯子读书的网站上获取本软件,也可以从得到疯子读书授权的第三方获取。如果你从未经疯子读书授权的第三方获取本软件或与本软件名称相同的安装程序,疯子读书无法保证本软件能够正常使用,并对因此给你造成的损失不予负责。
|
||||
</view>
|
||||
<view>2.2
|
||||
疯子读书可能为不同的终端设备开发了不同的软件版本,你应当根据实际情况选择下载合适的版本进行安装。下载安装程序后,你需要按照该程序提示的步骤正确安装。为提供更加优质、安全的服务,在本软件安装时疯子读书可能推荐你安装其他软件,你可以选择安装或不安装。
|
||||
</view>
|
||||
<view>2.3 如果你不再需要使用本软件或者需要安装新版软件,可以自行卸载。如果你愿意帮助疯子读书改进产品服务,请告知卸载的原因。 </view>
|
||||
<view>2.4
|
||||
为了改善用户体验、完善服务内容,疯子读书将不断努力开发新的服务,并为你不时提供软件更新(这些更新可能会采取软件替换、修改、功能强化、版本升级等形式)。为了保证本软件安全性和功能的一致性,疯子读书有权不经向你特别通知而对软件进行更新,或者对软件的部分功能效果进行改变或限制。本软件新版本发布后,旧版本的软件可能无法使用。疯子读书不保证旧版本软件继续可用及相应的客户服务,请你随时核对并下载最新版本。
|
||||
</view>
|
||||
<view class="dp_con1">四、【用户个人信息保护】 </view>
|
||||
<view class="dp_con2">1.
|
||||
保护用户个人信息是疯子读书的一项基本原则,疯子读书将会采取合理的措施保护用户的个人信息。除法律法规规定或本协议另有约定的情形外,未经用户许可疯子读书不会向第三方公开、透露用户个人信息。疯子读书对相关信息采用专业加密存储与传输方式,保障用户个人信息的安全。
|
||||
</view>
|
||||
<view class="dp_con2">2.
|
||||
你使用本服务的部分功能前需要有一个成功注册的微信帐号,并通过该微信帐号进行授权,授权内容包括但不限于:获得该微信帐号的公开信息(昵称、头像等)、寻找与你共同使用该应用的微信好友、帮助你分享信息到朋友圈等。对于你的微信帐号信息,疯子读书将采用专业加密存储与传输方式,保障信息安全,不会擅自收集、利用、透露或公开。用户有责任妥善保管你的微信帐号信息及帐号密码的安全,因你自身的原因导致微信帐号及密码泄漏,而造成的本服务下相关信息的泄露、篡改、删除等后果,疯子读书不承担任何责任。
|
||||
</view>
|
||||
<view class="dp_con2">3. 疯子读书将运用各种安全技术和程序建立完善的管理制度来保护你的个人信息,以免遭受未经授权的访问、使用或披露。 </view>
|
||||
<view class="dp_con2">4. 未经你的同意,疯子读书不会向疯子读书以外的任何公司、组织和个人披露你的个人信息,但法律法规另有规定或本协议另有约定的除外。 </view>
|
||||
<view class="dp_con1">五、【用户注意事项】 </view>
|
||||
<view class="dp_con2">1. 你理解并同意:为了向你提供有效的服务,本软件会利用你设备终端的处理器和带宽等资源。本软件使用过程中可能产生数据流量的费用,用户需自行向运营商了解相关资费信息,并自行承担相关费用。 </view>
|
||||
<view class="dp_con2">2. 你在使用本软件某一特定服务时,该服务可能会另有单独的协议、专项规则等,你在使用该项服务前请阅读并同意相关的单独协议、专项规则,包括但不限于适用于无限卡会员订阅服务的《会员订阅服务条款》等。
|
||||
</view>
|
||||
<view class="dp_con2">3. 你理解并同意疯子读书将会尽其商业上的合理努力保障你在本软件中的数据存储安全,但是,疯子读书并不能就此提供完全保证,包括但不限于以下情形: </view>
|
||||
<view>3.1 疯子读书不对你在本软件中相关数据的删除或储存失败负责; </view>
|
||||
<view>3.2 疯子读书有权根据实际情况自行决定单个用户在本软件中数据的最长储存期限,并在服务器上为其分配数据最大存储空间等; </view>
|
||||
<view>3.3 如果你停止使用本软件或服务被终止或取消,疯子读书可以从服务器上永久地删除你的数据。服务停止、终止或取消后,疯子读书没有义务向你返还任何数据。 </view>
|
||||
<view class="dp_con2">4. 用户在使用本软件时,须自行承担如下来自疯子读书不可掌控的风险内容,包括但不限于</view>
|
||||
<view>4.1 由于信息网络设备维护、连接故障,系统故障,电力故障,罢工,暴乱,火灾,洪水,风暴,爆炸,战争,政府行为,司法行政机关的命令或因第三方因素可能引起的个人信息丢失、泄漏及其他损害等风险;
|
||||
</view>
|
||||
<view>4.2 如使用本客户端软件,用户必须选择与所安装设备相匹配的软件版本,否则,由于软件与设备型号不相匹配所导致的任何问题或损害,均由用户自行承担; </view>
|
||||
<view>4.3 用户发布的内容或你的软件使用信息(包括但不限于使用本服务所产生的你的书架、你正在阅读的读物、你推荐的读物及你的读书想法等信息)被他人转发、分享,因此等传播可能带来的风险和责任; </view>
|
||||
<view>4.4 由于网络信号不稳定、网络带宽小等原因,所引起的本软件登录失败、资料同步不完整、页面打开速度慢等风险。 </view>
|
||||
<view class="dp_con2">
|
||||
5.
|
||||
你理解并同意,本服务可生成软件使用信息(包括但不限于你的书架、你正在阅读的读物、你推荐的读物及你的读书想法等信息),并向与你有微信好友关系的用户及其他用户开放浏览可见,用户之间可浏览对方因使用本服务所生成的全部或部分软件使用信息,你也可以选择对前述软件使用信息的可见范围等进行相关设置。
|
||||
</view>
|
||||
<view class="dp_con1">六、【用户行为规范】 </view>
|
||||
<view class="dp_con2">1. 【服务使用规范】 </view>
|
||||
<view>1.1
|
||||
你应遵守本协议使用本服务。你理解并同意,本服务是你与其他用户之间就读物阅读进行信息交流的平台,疯子读书不鼓励你在未经其他用户允许的前提下将其他用户使用本服务所产生的软件使用信息对外转发、分享、传播或用作其他违法或不合理用途。
|
||||
</view>
|
||||
<view class="dp_con2">2. 【信息内容规范】 </view>
|
||||
<view>2.1 本条所述信息内容是指用户使用本服务过程中所制作、复制、发布、传播的任何内容,包括但不限于图片、文字、相关链接页面等使用本服务所产生的内容。 </view>
|
||||
<view>2.2 你理解并同意,疯子读书一直致力于为用户提供文明健康、规范有序的网络环境,你不得利用本服务制作、复制、发布、传播如下干扰本服务正常运营,以及侵犯其他用户或第三方合法权益的内容,包括但不限于:
|
||||
</view>
|
||||
<view>2.2.1 发布、传送、传播、储存违反国家法律法规禁止的内容: </view>
|
||||
<view>(1)违反宪法确定的基本原则的; </view>
|
||||
<view>(2)危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的; </view>
|
||||
<view>(3)损害国家荣誉和利益的; </view>
|
||||
<view>(4)煽动民族仇恨、民族歧视,破坏民族团结的; </view>
|
||||
<view>(5)破坏国家宗教政策,宣扬邪教和封建迷信的; </view>
|
||||
<view>(6)散布谣言,扰乱社会秩序,破坏社会稳定的; </view>
|
||||
<view>(7)散布淫秽、色情、赌博、暴力、恐怖或者教唆犯罪的; </view>
|
||||
<view>(8)侮辱或者诽谤他人,侵害他人合法权益的; </view>
|
||||
<view>(9)煽动非法集会、结社、游行、示威、聚众扰乱社会秩序; </view>
|
||||
<view>(10)以非法民间组织名义活动的; </view>
|
||||
<view>(11)含有法律、行政法规禁止的其他内容的。 </view>
|
||||
<view>2.2.2 发布、传送、传播、储存侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的内容; </view>
|
||||
<view>2.2.3 未经他人许可发布、传送、传播涉及他人隐私、个人信息或资料的内容,但因使用本服务所默认生成并公布的软件使用信息除外; </view>
|
||||
<view>2.2.4 发表、传送、传播骚扰、广告信息及垃圾信息或含有任何性或性暗示的; </view>
|
||||
<view>2.2.5 其他违反法律法规、政策及公序良俗、社会公德或干扰本服务正常运营和侵犯其他用户或第三方合法权益内容的信息。 </view>
|
||||
<view class="dp_con2">3.【运营规范】 </view>
|
||||
<view>你使用本服务过程中不得从事下列行为: </view>
|
||||
<view>3.1 提交、发布虚假信息,或冒充、利用他人名义的; </view>
|
||||
<view>3.2 诱导其他用户点击链接页面或分享信息的; </view>
|
||||
<view>3.3 虚构事实、隐瞒真相以误导、欺骗他人的; </view>
|
||||
<view>3.4 侵害他人名誉权、肖像权、知识产权、商业秘密等合法权利的; </view>
|
||||
<view>3.5 未经疯子读书书面许可利用微信帐号和任何服务,以及第三方运营平台进行推广或互相推广的; </view>
|
||||
<view>3.6 利用本软件及服务从事任何违法犯罪活动的; </view>
|
||||
<view>3.7 制作、发布与以上行为相关的方法、工具,或对此类方法、工具进行运营或传播,无论这些行为是否为商业目的; </view>
|
||||
<view>3.8 其他违反法律法规规定、侵犯其他用户合法权益、干扰产品正常运营或疯子读书未明示授权的行为。 </view>
|
||||
<view class="dp_con2">4.【对自己行为负责】 </view>
|
||||
<view>
|
||||
你充分了解并同意,你必须为自己注册帐号下的一切行为负责,包括你所发表的任何内容以及由此产生的任何后果。你应对本服务中的内容自行加以判断,并承担因使用内容而引起的所有风险,包括因对内容的正确性、完整性或实用性的依赖而产生的风险;同时,你应在本协议约定的范围内使用本服务,因你利用本服务进行违反法律法规、本协议、专项规则的行为所产生的风险亦由你自行承担。疯子读书无法且不会对因前述风险而导致的任何损失或损害承担责任。
|
||||
</view>
|
||||
<view class="dp_con1">七、【管理规范】 </view>
|
||||
<view class="dp_con2">
|
||||
1.
|
||||
疯子读书有权根据国家相关法规政策,按照本协议的规定,对你发布、传送、传播、储存的内容进行审查,以保证用户使用本服务的行为不违反法律法规及社会公共道德准则、不侵犯疯子读书或第三方的合法权益、不带有诋毁疯子读书及其产品形象的要素。但并不因为疯子读书的审核而减轻你自身使用本服务时应承担的责任,由此产生的一切责任和后果仍由你单独承担。
|
||||
</view>
|
||||
<view class="dp_con2">
|
||||
2.
|
||||
如果疯子读书发现或收到他人举报或投诉用户违反本协议约定的,疯子读书有权不经通知随时对相关内容进行删除、屏蔽,并视行为情节对违规帐号处以包括但不限于警告、限制或禁止使用部分或全部服务、帐号封禁直至注销的处罚,并公告处理结果。
|
||||
</view>
|
||||
<view class="dp_con2">
|
||||
3.
|
||||
你理解并同意,疯子读书有权依合理判断对违反有关法律法规或本协议规定的行为进行处罚,对违法违规的任何用户采取适当的法律行动,并依据法律法规保存有关信息向有关部门报告等,用户应独自承担由此而产生的一切法律责任。
|
||||
</view>
|
||||
<view class="dp_con2">4. 你理解并同意,因你违反本协议或相关服务条款的规定,导致或产生第三方主张的任何索赔、要求或损失,你应当独立承担责任;疯子读书因此遭受损失的,你也应当一并赔偿。 </view>
|
||||
<view class="dp_con1">八、【知识产权声明】 </view>
|
||||
<view class="dp_con2">1.
|
||||
疯子读书是本软件的知识产权权利人。本软件的一切著作权、商标权、专利权、商业秘密等知识产权,以及与本软件相关的所有信息内容(包括但不限于文字、图片、音频、视频、图表、界面设计、版面框架、有关数据或电子文档等)均受中华人民共和国法律法规和相应的国际条约保护,疯子读书享有上述知识产权,但相关权利人依照法律规定应享有的权利除外。
|
||||
</view>
|
||||
<view class="dp_con2">2. 未经疯子读书或相关权利人书面同意,你不得为任何商业或非商业目的自行或许可任何第三方实施、利用、转让上述知识产权。 </view>
|
||||
<view class="dp_con1">九、【终端安全责任】 </view>
|
||||
<view class="dp_con2">1.
|
||||
你理解并同意,本软件同大多数互联网软件一样,可能会受多种因素影响,包括但不限于用户原因、网络服务质量、社会环境等;也可能会受各种安全问题的侵扰,包括但不限于他人非法利用用户资料,进行现实中的骚扰;用户下载安装的其他软件或访问的其他网站中可能含有病毒、木马程序或其他恶意程序,威胁你的终端设备信息和数据安全,继而影响本软件的正常使用等。因此,你应加强信息安全及个人信息的保护意识,注意密码保护,以免遭受损失。
|
||||
</view>
|
||||
<view class="dp_con2">2. 你不得制作、发布、使用、传播用于窃取微信帐号及他人个人信息、财产的恶意程序。 </view>
|
||||
<view class="dp_con2">3. 维护软件安全与正常使用是疯子读书和你的共同责任,疯子读书将按照行业标准合理审慎地采取必要技术措施保护你的终端设备信息和数据安全,但是你承认和同意疯子读书并不能就此提供完全保证。 </view>
|
||||
<view class="dp_con2">4. 在任何情况下,你不应轻信借款、索要密码或其他涉及财产的网络信息。涉及财产操作的,请一定先核实对方身份,并请经常留意疯子读书有关防范诈骗犯罪的提示。 </view>
|
||||
<view class="dp_con1">十、【未成年人保护】 </view>
|
||||
<view class="dp_con2">疯子读书非常重视对未成年人个人信息的保护。若你是18周岁以下的未成年人,在使用疯子读书的服务前,应事先取得你监护人的书面同意。</view>
|
||||
<view class="dp_con1">十一、【其他】 </view>
|
||||
<view class="dp_con2">1.
|
||||
你使用本软件即视为你已阅读并同意受本协议的约束。疯子读书有权在必要时修改本协议条款。你可以在本软件的最新版本中查阅相关协议条款。本协议条款变更后,如果你继续使用本软件,即视为你已接受修改后的协议。如果你不接受修改后的协议,应当停止使用本软件。
|
||||
</view>
|
||||
<view class="dp_con2">2. 本协议签订地为中华人民共和国天津市南开区。 </view>
|
||||
<view class="dp_con2">3. 本协议的成立、生效、履行、解释及纠纷解决,适用中华人民共和国大陆地区法律(不包括冲突法)。 </view>
|
||||
<view class="dp_con2">4. 若你和疯子读书之间发生任何纠纷或争议,首先应友好协商解决;协商不成的,你同意将纠纷或争议提交本协议签订地有管辖权的人民法院管辖。 </view>
|
||||
<view class="dp_con2">5. 本协议所有条款的标题仅为阅读方便,本身并无实际涵义,不能作为本协议涵义解释的依据。</view>
|
||||
<view class="dp_con2">6. 本协议条款无论因何种原因部分无效或不可执行,其余条款仍有效,对双方具有约束力。(正文完) </view>
|
||||
<view>天津众妙之门科技有限公司 </view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<style scoped lang="less">
|
||||
.dp_title {
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 50rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_content {
|
||||
max-height: 1000rpx;
|
||||
overflow-y: scroll;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
line-height: 45rpx;
|
||||
|
||||
.dp_con1 {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.dp_con2 {
|
||||
font-size: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
191
pages/agreement/yszcPage.vue
Normal file
191
pages/agreement/yszcPage.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="dp_title" v-html="yszcText.title"></view>
|
||||
<view class="dp_content" v-html="yszcText.content"></view>
|
||||
|
||||
<!-- <view class="dp_title">隐私策略</view>
|
||||
<view class="dp_content">
|
||||
<view class="dp_con1" style="margin-top: 0;">一、隐私保护</view>
|
||||
<view class="dp_con2">
|
||||
1.
|
||||
用户同意,个人隐私信息是指那些能够对用户进行个人辨识或涉及个人通信的信息,包括下列信息:用户真实姓名,身份证号,手机号码,IP地址。而非个人隐私信息是指用户对本服务的操作状态以及使用习惯等一些明确且客观反映在本公司服务器端的基本记录信息和其他一切个人隐私信息范围外的普通信息,以及用户同意公开的上述隐私信息;
|
||||
</view>
|
||||
<view class="dp_con2">
|
||||
2.
|
||||
保护用户(特别是未成年人)的隐私是疯子读书的一项基本政策,疯子读书将对用户所提供的资料进行严格的管理及保护,并使用相应的技术,防止用户的个人资料丢失、被盗用或遭篡改,保证不对外公开或向第三方提供单个用户的注册资料及用户在使用网络服务时存储在疯子读书的非公开内容,但下列情况除外:
|
||||
</view>
|
||||
<view>2.1 事先获得用户的明确授权;</view>
|
||||
<view>2.2 根据有关的法律法规要求;</view>
|
||||
<view>2.3 按照相关政府主管部门的要求;</view>
|
||||
<view>2.4 为维护社会公众的利益;</view>
|
||||
<view>2.5 为维护疯子读书的合法权益。</view>
|
||||
<view class="dp_con2">
|
||||
3. 任何时候如果您对我们的隐私策略有疑问,请利用电子邮件huashengxiangyue@163.com联系我们,我们会尽一切努力,请合理适当的范围内立即改善这个问题。
|
||||
</view>
|
||||
<view class="dp_con1">二、第三方信息共享清单:</view>
|
||||
<view class="dp_con2">aliPay SDK(支付宝支付sdk):</view>
|
||||
<view class="dp_con2">共享的信息:收款账户信息,订单数据信息</view>
|
||||
<view class="dp_con2">wxpay SDK (微信支付sdk)</view>
|
||||
<view class="dp_con2">共享的信息:收款账户信息,订单数据信息</view>
|
||||
<view class="dp_con1">三、我们获取的您的信息</view>
|
||||
<view>您使用服务时我们可能收集已经经过您授权获取或主动填写的如下信息:</view>
|
||||
<view class="dp_con2">1、日志信息,指您使用我们的服务时,系统可能通过自动采集的技术信息,包括:</view>
|
||||
<view>1.1 获取设备信息或获取已安装APP信息,例如您的移动设备、网页浏览器或用于接入我们服务的其他程序所提供的配置信息、您的IP地址和移动设备所用的版本和设备识别码。</view>
|
||||
<view>1.2 您通过我们的服务进行通讯的信息,例如曾通讯的账号。</view>
|
||||
<view>1.3 您通过我们的服务分享的内容所包含的信息(元数据),例如拍摄或上传的共享照片或录像的日期、时间或地点等。</view>
|
||||
<view class="dp_con2">2、位置信息,指您开启设备定位功能并使用我们基于位置提供的相关服务时,收集的有关您位置的信息,包括:</view>
|
||||
<view>2.1 您通过具有定位功能的移动设备使用我们的服务时,通过GPS或WiFi等方式收集的您的地理位置信息用于 健康超市收货 提供位置信息。</view>
|
||||
<view>
|
||||
2.2 您或其他用户提供的包含您所处地理位置的实时信息,例如您提供的账户信息中包含的您所在地区信息,您上传的显示您当前或曾经所处地理位置的共享信息,您或其他人共享的照片包含的地理标记信息。
|
||||
</view>
|
||||
<view>2.3 您可以通过关闭定位功能,停止对您的地理位置信息的收集。</view>
|
||||
<view class="dp_con2">
|
||||
3. 设备信息,包括:
|
||||
</view>
|
||||
<view>3.1 在使用“疯子读书”时可能获取并上传您的的设备信息(Android_ID),网络设备硬件地址(MAC地址),获取手机状态,获取其中的设备序列号用于验证手机型号及安卓版本。</view>
|
||||
<view>3.2 获取OAID,用以标记设备唯一性。</view>
|
||||
<view>3.3 获取定位信息,用于应用获取您的位置信息提供应用服务。</view>
|
||||
<view>3.4 获取软件安装列表,用以第三方应用、服务或链接。</view>
|
||||
<view class="dp_con2">4. 根据相关法律法规及国家标准,在以下情形中,我们可能会依法收集并使用您的个人信息无需征得您的同意:</view>
|
||||
<view>4.1 与国家安全、国防安全直接相关的。</view>
|
||||
<view>4.2 与公共安全、公共卫生、重大公共利益直接相关的。</view>
|
||||
<view>4.3 与犯罪侦查、起诉、审判和判决执行等直接相关的。</view>
|
||||
<view>4.4 出于维护您或他人的生命、财产等重大合法权益但又很难得到您本人同意的。</view>
|
||||
<view>4.5 所收集的个人信息是您自行向社会公众公开的。</view>
|
||||
<view>4.6 根据您的要求签订和履行合同所必需的。</view>
|
||||
<view>4.7 用于维护所提供的服务的安全稳定运行所必需的,例如:发现、处置服务的故障。</view>
|
||||
<view>4.8 法律法规规定的其他情形。</view>
|
||||
<view class="dp_con1">四. 我们可能如何使用信息</view>
|
||||
<view>我们可能将在向您提供服务的过程之中所收集的信息用作下列用途:</view>
|
||||
<view class="dp_con2">1. 向您提供服务。</view>
|
||||
<view class="dp_con2">2. 在我们提供服务时,用于身份验证、客户服务、安全防范等用途,确保我们向您提供的产品和服务的安全性。</view>
|
||||
<view class="dp_con2">3. 帮助我们设计新服务,改善我们现有服务。</view>
|
||||
<view class="dp_con2">4. 让您参与有关我们产品和服务的调查。</view>
|
||||
<view class="dp_con1">五. 您如何访问和控制自己的个人信息</view>
|
||||
<view>我们非常重视您对个人信息的管理,并尽全力保护您对于您个人信息的查询、访问、修改、删除、撤回同意授权、注销账号功能的相关权利,以使您有能力保障您的隐私和信息安全。</view>
|
||||
<view class="dp_con2">1. 您可以在设备本身操作系统中关闭GPS地理位置、摄像头、麦克风、相册权限改变同意范围或撤回您的授权。撤回授权后我们将不再收集与这些权限相关信息。
|
||||
</view>
|
||||
<view class="dp_con2">
|
||||
2.
|
||||
特定的业务功能和服务将需要您的信息才能得以完成,当您撤回同意或授权后,我们无法继续为您提供撤回同意或授权所对应的功能和服务,也不再处理您相应的个人信息。但您撤回同意或授权的决定,不会影响此前基于您的授权而开展的个人信息处理。
|
||||
</view>
|
||||
<view class="dp_con2">3. 访问、更正您的个人信息,您可以查询、访问您的头像、用户名、昵称等信息。</view>
|
||||
<view class="dp_con2">
|
||||
4. 注销账号:账号注销采用客服注销的形式,注销流程:先APP内提交注销账户操作,然后联系官方客服客服;提交注销申请路径:我的》注销账户,客服电话:022-24142321
|
||||
</view>
|
||||
<view class="dp_con1">六、信息安全</view>
|
||||
<view>我们仅在本《隐私协议》所述目的所必需的期间和法律法规要求的时限内保留您的个人信息。</view>
|
||||
<view class="dp_con2">
|
||||
1. 我们非常重视您个人信息的安全,将努力采取合理的安全措施(包括技术方面和管理方面)来保护您的个人信息,防止您提供的个人信息被不当使用或未经授权的情况下被访问、公开披露、使用、修改、损坏、丢失或泄漏。
|
||||
</view>
|
||||
<view class="dp_con2">2. 我们会使用加密技术、匿名化处理及相关合理可行的手段保护您的个人信息,并使用安全保护机制防止您的个人信息遭到恶意攻击。</view>
|
||||
<view class="dp_con2">3. 我们依照法律法规的规定,将在境内运营过程中收集和产生的您的个人信息存储于中华人民共和国境内。目前,我们不会将上述信息传输至境外。</view>
|
||||
<view class="dp_con2">
|
||||
4.
|
||||
您知悉并理解,您接入我们的服务所用的系统和通讯网络,有可能因我们可控范围外的因素而出现问题。因此,我们强烈建议您采取积极措施保护个人信息的安全,包括但不限于使用复杂密码、定期修改密码、不将自己的账号密码及相关个人信息透露给他人。
|
||||
</view>
|
||||
<view class="dp_con2">
|
||||
5.
|
||||
我们会制定应急处理预案,并在发生用户信息安全事件时立即启动应急预案,努力阻止这些安全事件的影响和后果扩大。一旦发生用户信息安全事件(泄露、丢失)后,我们将按照法律法规的要求,及时向您告知:安全事件的基本情况和可能的影响、我们已经采取或将要采取的处置措施、您可自主防范和降低风险的建议、对您的补救措施。我们将及时将事件相关情况以推送通知、短信及相关形式告知您,难以逐一告知时,我们会采取合理、有效的方式发布公告。同时,我们还将按照相关监管部门要求,上报用户信息安全事件的处置情况。
|
||||
</view>
|
||||
<view class="dp_con1">七、知识产权</view>
|
||||
<view class="dp_con2">1. 天津众妙之门科技有限公司系疯子读书的著作权人,未经疯子读书许可,用户不得对该软件进行反向工程(reverse
|
||||
engineer)、反向编译(decompile)或反汇编(disassemble)。</view>
|
||||
<view class="dp_con2">
|
||||
2.
|
||||
疯子读书提供的网络服务中包含的任何文本、图片、图形、音频和/或视频资料均受版权、商标和/或其它财产所有权法律的保护,未经相关权利人同意,上述资料均不得在任何媒体直接或间接发布、播放、出于播放或发布目的而改写或再发行,或者被用于其他任何商业目的。所有这些资料或资料的任何部分仅可作为私人和非商业用途而保存在用户终端内。疯子读书不就由上述资料产生或在传送或递交全部或部分上述资料过程中产生的延误、不准确、错误和遗漏或从中产生或由此产生的任何损害赔偿,以任何形式,向用户或任何第三方负责。
|
||||
</view>
|
||||
<view class="dp_con2">3. 疯子读书所有作品内容仅代表作者自己的立场和观点,与疯子读书无关,由作者本人承担一切法律责任。</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
<script>
|
||||
import $http from '@/config/requestConfig.js';
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
yhxyText: {},
|
||||
yszcText: {},
|
||||
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
|
||||
this.getSettlement()
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
|
||||
this.getSettlement()
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
|
||||
// 获取协议内容
|
||||
getSettlement() {
|
||||
this.$http
|
||||
.post('sys/agreement/getPrivacyDetail')
|
||||
.then(res => {
|
||||
|
||||
this.yszcText = res.privacy
|
||||
this.yszcText.content = this.yszcText.content.replace(/<p>/g, '');
|
||||
this.yszcText.content = this.yszcText.content.replace(/<\/p>/g, '<br/>');
|
||||
console.log(this.yszcText.content)
|
||||
|
||||
}).catch((e) => {
|
||||
console.log(e, 'e')
|
||||
})
|
||||
this.$http
|
||||
.post('sys/agreement/getUserDetail')
|
||||
.then(res => {
|
||||
|
||||
this.yhxyText = res.user
|
||||
|
||||
}).catch((e) => {
|
||||
console.log(e, 'e')
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.dp_title {
|
||||
font-size: 36rpx;
|
||||
margin-bottom: 50rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_content {
|
||||
max-height: 1000rpx;
|
||||
overflow-y: scroll;
|
||||
font-size: 28rpx;
|
||||
color: #555;
|
||||
line-height: 45rpx;
|
||||
|
||||
.dp_con1 {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
margin-top: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.dp_con2 {
|
||||
font-size: 30rpx;
|
||||
margin-top: 10rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
400
pages/bookShop/bookShopIndex.vue
Normal file
400
pages/bookShop/bookShopIndex.vue
Normal file
@@ -0,0 +1,400 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="shopHeader">
|
||||
<!-- 顶部导航栏 -->
|
||||
<z-nav-bar title="健康超市"></z-nav-bar>
|
||||
<!-- 搜索 -->
|
||||
<!-- <view class="search" @click="goSearch()">
|
||||
<u-search placeholder="请输入需4545要的商品" v-model="keyword" :show-action="false"></u-search>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 主盒子 -->
|
||||
<view class="indexBox">
|
||||
<!-- 轮播图 -->
|
||||
<view class="swiper_box">
|
||||
<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
|
||||
<swiper-item v-for="(item,index) in swiperlist" :key="index">
|
||||
<view class="swiper-item">
|
||||
<image :src="item.image" mode="widthFix " class="swiperImg"></image>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<!-- 分类 -->
|
||||
<view class="head_line">
|
||||
<b></b>
|
||||
<text>商品分类</text>
|
||||
</view>
|
||||
<view class="classfy">
|
||||
<view v-for="(item,index) in gridArr" :key="index" @click='toClassify(item.catId,index)'>
|
||||
<!-- <u-icon v-if="item.icon" :name="item.icon" :size="46"></u-icon> -->
|
||||
<image :src="item.icon"></image>
|
||||
<text class="grid-text">{{item.name}}</text>
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
<!-- 商品展示 -->
|
||||
<view class="head_line">
|
||||
<b></b>
|
||||
<text>限时秒杀</text>
|
||||
<i @click="onShopMore('Sale')">查看更多 ></i>
|
||||
</view>
|
||||
<!-- 限时秒杀 -->
|
||||
<view class="limited">
|
||||
<view class="limitedSymbol">
|
||||
<image src="../../static/icon/shopping_xsh.png"></image>
|
||||
</view>
|
||||
<view class="limitedScrollBox">
|
||||
<u-scroll-list indicatorActiveColor="#27b386">
|
||||
<view class="limitedItem" v-for="(item,index) in seckillList" :key="index"
|
||||
@click="goDetail(item.prodInfo.productId)">
|
||||
<image :src="item.prodInfo.productImages" mode=""></image>
|
||||
<text class="biaoti">{{item.prodInfo.productName}}</text>
|
||||
<text class="xian">¥{{item.seckillPrice}}</text>
|
||||
<text class="yuan">¥{{item.prodInfo.price}}</text>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 商品展示 -->
|
||||
<view class="head_line">
|
||||
<b></b>
|
||||
<text>精选商品</text>
|
||||
<i @click="onShopMore('Hot')">查看更多 ></i>
|
||||
</view>
|
||||
<view class="goods">
|
||||
<view class="goodsItem" v-for="(item,index) in goodsList" :key="item.productId"
|
||||
@click="goDetail(item.productId)">
|
||||
<image :src="item.productImages" mode="" class="goodsImg"></image>
|
||||
<view class="goodsContent">
|
||||
<view class="goodsName">
|
||||
{{item.productName}}
|
||||
</view>
|
||||
<view class="goodsPrice">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
<view style="height: 30rpx;"></view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
keyword: '', // 搜索索引值
|
||||
// 轮播图数据
|
||||
swiperlist: [{
|
||||
image: '../../static/icon/home_ban_1.jpg',
|
||||
},
|
||||
{
|
||||
image: '../../static/icon//home_ban_2.jpg',
|
||||
},
|
||||
{
|
||||
image: '../../static/icon//home_ban_3.jpg',
|
||||
}
|
||||
],
|
||||
totalCount: 4,
|
||||
pageSize: 1,
|
||||
totalPage: 4,
|
||||
currPage: 1,
|
||||
limit: 4,
|
||||
page: 1,
|
||||
istop: 1, // 是否是精选商品
|
||||
// 秒杀列表
|
||||
seckillList: [],
|
||||
// 商品列表
|
||||
goodsList: [],
|
||||
// 分类数据
|
||||
gridArr: [{
|
||||
icon: "list-dot",
|
||||
name: '更多'
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
onLoad() {
|
||||
// 获取分类
|
||||
this.$http
|
||||
.post('book/shopcategory/getOneLevel')
|
||||
.then(res => {
|
||||
// 用一个空数组去接分类数据
|
||||
let arr = []
|
||||
if (res.list.length >= 5) {
|
||||
for (let i in res.list) {
|
||||
if (i < 5) {
|
||||
arr.push({
|
||||
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
|
||||
name: res.list[i].name,
|
||||
catId: res.list[i].catId
|
||||
})
|
||||
}
|
||||
}
|
||||
arr.push({
|
||||
icon: "../../static/icon/shop_bar_more.png",
|
||||
name: '更多'
|
||||
})
|
||||
this.gridArr = arr
|
||||
}
|
||||
})
|
||||
|
||||
// 获取限时秒杀
|
||||
this.$http
|
||||
.get(`book/shopseckill/getSeckillProd`)
|
||||
.then(res => {
|
||||
this.seckillList = res.list
|
||||
console.log(this.seckillList)
|
||||
})
|
||||
|
||||
// 获取精选商品
|
||||
this.$http
|
||||
.post(`book/shopproduct/appGetList?limit=${this.limit}&page=${this.page}&istop=${this.istop}`)
|
||||
.then(
|
||||
res => {
|
||||
this.goodsList = res.page.list
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 跳转详情页
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: './commodityDetail?id=' + id
|
||||
});
|
||||
},
|
||||
|
||||
// 跳转分类页
|
||||
toClassify(catId, index) {
|
||||
if (catId) {
|
||||
uni.navigateTo({
|
||||
url: `./classify?type=${index}`
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: './classifyAll'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转搜索页
|
||||
goSearch() {
|
||||
uni.navigateTo({
|
||||
url: './commoditySearch'
|
||||
})
|
||||
},
|
||||
|
||||
// 列表跳页
|
||||
onShopMore(e) {
|
||||
uni.navigateTo({
|
||||
url: './bookShopType?type=' + e
|
||||
});
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.shopHeader {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.search {
|
||||
padding: 10rpx;
|
||||
background-color: #fff;
|
||||
margin: 10rpx 0;
|
||||
|
||||
}
|
||||
|
||||
.swiper_box {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
|
||||
.swiper-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.swiperImg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.classfy {
|
||||
margin: 0 10rpx;
|
||||
border-radius: 30rpx;
|
||||
|
||||
view {
|
||||
float: left;
|
||||
width: 16.6%;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.grid-text {
|
||||
font-size: 25rpx;
|
||||
margin-top: 4rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.head_line {
|
||||
margin: 30rpx 0 30rpx 0;
|
||||
padding: 10rpx;
|
||||
|
||||
b {
|
||||
display: inline-block;
|
||||
width: 12rpx;
|
||||
height: 40rpx;
|
||||
background-color: #54a966;
|
||||
vertical-align: bottom;
|
||||
margin: 0 20rpx 0 0;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
i {
|
||||
float: right;
|
||||
font-style: normal;
|
||||
color: #8b8a91;
|
||||
font-size: 24rpx;
|
||||
margin: 15rpx 35rpx 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.limited {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
margin-top: 10rpx;
|
||||
|
||||
.limitedSymbol {
|
||||
width: 22%;
|
||||
height: 300rpx;
|
||||
border-right: 1px solid #eee;
|
||||
vertical-align: middle;
|
||||
|
||||
image {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
margin: 45px auto 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.limitedScrollBox {
|
||||
width: 76%;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.limitedItem {
|
||||
width: 200rpx;
|
||||
text-align: center;
|
||||
|
||||
image {
|
||||
width: 150upx;
|
||||
height: 200upx;
|
||||
margin: 15rpx auto 20rpx auto;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.biaoti {
|
||||
font-size: 30rpx;
|
||||
margin: 10rpx 0 10rpx 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.xian {
|
||||
font-size: 32rpx;
|
||||
color: #bf0c0c;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.yuan {
|
||||
text-decoration: line-through;
|
||||
color: #c1c1c1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goods {
|
||||
width: 100%;
|
||||
|
||||
|
||||
.goodsItem {
|
||||
display: inline-block;
|
||||
width: 46%;
|
||||
border-radius: 20rpx;
|
||||
padding: 25rpx 25rpx 20rpx 25rpx;
|
||||
margin: 0 20rpx 20rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border: 1px solid #eee;
|
||||
|
||||
.goodsImg {
|
||||
width: 98%;
|
||||
height: 380rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.goodsContent {
|
||||
|
||||
.goodsName {
|
||||
margin-top: 10rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.goodsPrice {
|
||||
font-size: 30rpx;
|
||||
margin: 5rpx 0 0 3rpx;
|
||||
color: #bf0c0c;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.goodsItem:nth-child(2n) {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
330
pages/bookShop/bookShopType.vue
Normal file
330
pages/bookShop/bookShopType.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar :title="title"></z-nav-bar>
|
||||
|
||||
<view class="shop_list">
|
||||
<view class="sl_tioa" v-for="(item,index) in shopList" @click="onShopJump(item)">
|
||||
<image :src="item.productImages"></image>
|
||||
<view class="sl_cont">
|
||||
<view class="sl_tit">
|
||||
<text class="bok_name">
|
||||
{{item.productName}}
|
||||
<span v-if="item.productStock==0" style="color: #aaa;font-size:26rpx;">(无货)</span>
|
||||
</text>
|
||||
</view>
|
||||
<view class="sl_ric">
|
||||
¥{{item.price}}
|
||||
</view>
|
||||
<view class="sl_del" v-if="shopScreen.type == 'Sale'">
|
||||
¥{{item.oldprice}}
|
||||
</view>
|
||||
<view class="sl_gou" v-if="item.productStock>0" @click.stop="addShopCar(item)">
|
||||
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
<view style="height: 1px;"></view>
|
||||
</view>
|
||||
|
||||
|
||||
<view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
<u-loading-icon style="display: inline-block;"></u-loading-icon>
|
||||
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="padding-bottom: 20rpx;">
|
||||
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
scrollTop: 0,
|
||||
status: 3,
|
||||
shopScreen: {
|
||||
type: '',
|
||||
page: 1, //当前页码数
|
||||
limit: 5, //单页数据数量
|
||||
},
|
||||
productInfo: {},
|
||||
totalPage: 0,
|
||||
totalCount: 0,
|
||||
shopList: [],
|
||||
bgiStyle: {
|
||||
background: '#2ab58833'
|
||||
},
|
||||
iconStyle: {
|
||||
fontSize: '40rpx',
|
||||
fontWeight: 'bold',
|
||||
color: '#54a966',
|
||||
},
|
||||
urList: '',
|
||||
title: '',
|
||||
}
|
||||
},
|
||||
|
||||
// 返回顶部
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onReachBottom() {
|
||||
this.status = 0
|
||||
if (this.shopScreen.page < this.totalPage) {
|
||||
this.shopScreen.page = this.shopScreen.page + 1
|
||||
setTimeout(() => {
|
||||
if (this.shopScreen.type == 'Hot') {
|
||||
this.$http
|
||||
.post(this.urList + '?page=' + this.shopScreen.page + '&limit=' + this.shopScreen
|
||||
.limit)
|
||||
.then(res => {
|
||||
this.totalPage = res.page.totalPage
|
||||
this.totalCount = res.page.totalCount
|
||||
for (let i in res.page.list) {
|
||||
this.shopList.push(res.page.list[i])
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 1000)
|
||||
} else {
|
||||
this.status = 1
|
||||
}
|
||||
},
|
||||
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
this.shopScreen.type = e.type
|
||||
if (this.shopScreen.type == 'Sale') {
|
||||
this.urList = 'book/shopseckill/getSeckillProd'
|
||||
this.title = '限时秒杀'
|
||||
} else if (this.shopScreen.type == 'Hot') {
|
||||
this.urList = 'book/shopproduct/appGetList'
|
||||
this.title = '精选商品'
|
||||
}
|
||||
|
||||
this.getData();
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// this.getData();
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.getData()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
// 获取列表数据
|
||||
getData() {
|
||||
console.log(this.urList)
|
||||
this.shopList = []
|
||||
if (this.shopScreen.type == 'Hot') {
|
||||
this.$http
|
||||
.post(this.urList + '?page=' + this.shopScreen.page + '&limit=' + this.shopScreen.limit)
|
||||
.then(res => {
|
||||
this.shopList = res.page.list
|
||||
this.totalPage = res.page.totalPage
|
||||
this.status = 3
|
||||
});
|
||||
} else if (this.shopScreen.type == 'Sale') {
|
||||
this.$http
|
||||
.get(this.urList)
|
||||
.then(res => {
|
||||
let arr = []
|
||||
for (let i in res.list) {
|
||||
arr.push({
|
||||
productImages: res.list[i].prodInfo.productImages,
|
||||
productName: res.list[i].prodInfo.productName,
|
||||
price: res.list[i].seckillPrice,
|
||||
oldprice: res.list[i].prodInfo.price,
|
||||
productId: res.list[i].prodInfo.productId,
|
||||
})
|
||||
}
|
||||
this.shopList = arr
|
||||
this.status = 3
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 加入购物车
|
||||
addShopCar(e) {
|
||||
this.$http
|
||||
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
|
||||
.then(res => {
|
||||
this.cartList = res.cartList
|
||||
// 统计商品信息
|
||||
let data = {
|
||||
"userId": this.userInfo.id,
|
||||
"productId": e.productId,
|
||||
"productAmount": 1,
|
||||
"price": e.price
|
||||
}
|
||||
console.log(e)
|
||||
// 判断列表是否为空
|
||||
if (this.cartList.length > 0) {
|
||||
let flag = ''
|
||||
let shagnpin = {}
|
||||
// 循环购物车列表
|
||||
flag = this.cartList.some((item, index) => {
|
||||
if (item.productId == data.productId) {
|
||||
shagnpin = item
|
||||
shagnpin.productAmount = item.productAmount + 1
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
// 已在购物车中添加
|
||||
$http.request({
|
||||
url: "book/ordercart/update",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: shagnpin,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 加入购物车
|
||||
$http.request({
|
||||
url: "book/ordercart/save",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// 购物车列表为空时直接加入购物车
|
||||
$http.request({
|
||||
url: "book/ordercart/save",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 商品内容跳转
|
||||
onShopJump(e) {
|
||||
uni.navigateTo({
|
||||
url: './commodityDetail?id=' + e.productId
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
|
||||
|
||||
|
||||
.shop_list {
|
||||
margin: 30rpx;
|
||||
|
||||
.sl_tioa {
|
||||
box-shadow: 0 0px 10px 1px #d3d1d133;
|
||||
background-color: #fff;
|
||||
padding: 25rpx;
|
||||
margin: 0 0 20rpx 0;
|
||||
border-radius: 15rpx;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
width: 160upx;
|
||||
height: 240upx;
|
||||
float: left;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.sl_cont {
|
||||
float: left;
|
||||
|
||||
|
||||
.sl_tit {
|
||||
max-width: 420rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.sl_ric {
|
||||
color: #bf0c0c;
|
||||
font-weight: bold;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.sl_del {
|
||||
text-decoration: line-through;
|
||||
color: #c1c1c1;
|
||||
font-size: 30rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.sl_gou {
|
||||
background-color: #fbf6ec;
|
||||
border-radius: 50rpx;
|
||||
padding: 5rpx;
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
bottom: 40rpx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
455
pages/bookShop/classify.vue
Normal file
455
pages/bookShop/classify.vue
Normal file
@@ -0,0 +1,455 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<z-nav-bar title="健康超市"></z-nav-bar>
|
||||
<!-- 一级分类 -->
|
||||
<view class="oneBox">
|
||||
<view class="oneLevel">
|
||||
<u-tabs :scrollable="false" :current="current" lineWidth="42" :inactiveStyle="{fontSize:'32rpx'}"
|
||||
:list="oneLevel" @click="getTowLevel" lineColor="#54a966"
|
||||
:activeStyle="{color: '#303133',fontWeight: 'bold', transform: 'scale(1.01)'}"></u-tabs>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="search_box" @click="onPageJump('../peanut/searchFor')">
|
||||
<text class="icon_search"></text>
|
||||
<text class="prompt">搜索...</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 二级分类、商品 -->
|
||||
<view class="twoBox" style="">
|
||||
<!-- <u-sticky> -->
|
||||
<u-tabs v-if="utabs" :list="towLevel" :current = "0" :inactiveStyle="{fontSize:'28rpx'}" lineWidth="40" @click="getCategoryList"
|
||||
:activeStyle="{transform: 'scale(1.01)'}"></u-tabs>
|
||||
<!-- </u-sticky> -->
|
||||
</view>
|
||||
<view class="classfyBody">
|
||||
<!-- 二级分类、商品 -->
|
||||
<view class="towLevel" v-if="towLevel.length > 0">
|
||||
<view class="towLevelContent" v-if="commodityList && commodityList.length > 0">
|
||||
<view class="commodityItem" v-for="(item,index) in commodityList" :key="index"
|
||||
@click.stop="toDetail(item.productId)">
|
||||
<view class="box">
|
||||
<image :src="item.productImages" mode=""></image>
|
||||
<view class="commodityContent">
|
||||
<view class="commodityTitle">
|
||||
{{item.productName}}
|
||||
<span v-if="item.productStock==0" style="color: #aaa;font-size:26rpx;">(暂无库存)</span>
|
||||
</view>
|
||||
<view class="commodityPrice">
|
||||
<text class="price" v-if="item.price">¥
|
||||
<b style="font-size: 40rpx;">{{item.price}}</b>
|
||||
<span class="priceTag" v-if="item.activityPrice">原价:¥{{item.activityPrice}}</span>
|
||||
</text>
|
||||
<text class="SoldNumber" v-if="item.sumSales">已售<span>{{item.sumSales}}</span>件</text>
|
||||
<!-- <text class="icon" @click.stop="addShopCar(item)" v-if="item.productStock">
|
||||
<u-icon name="shopping-cart" :size="26" color="#eba00b"></u-icon>
|
||||
</text> -->
|
||||
<view class="publierInfo" v-if="item.author && item.publisher">
|
||||
<span class="c999 f24">{{item.author}}著</span><span class="c999 f24">/ {{item.publisher}}</span>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else style="text-align: center;font-size: 30rpx;color: #888;margin: 20rpx 0 0 0;flex: 1;">
|
||||
暂无商品
|
||||
</view>
|
||||
</view>
|
||||
<view v-else style="text-align: center;font-size:30rpx;color: #888;margin: 50rpx 0 0 0;">
|
||||
暂无分类
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<u-back-top :scroll-top="scrollTop" bottom="60" :customStyle='bgiStyle' :iconStyle="iconStyle"></u-back-top>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
highlight: '', // 高亮下标
|
||||
current: 0,
|
||||
twocurrent:0,
|
||||
oneLevel: [],
|
||||
towLevel: [],
|
||||
commodityList: [] ,// 商品列表
|
||||
utabs:false,
|
||||
bgiStyle: {
|
||||
background: '#2ab58833'
|
||||
},
|
||||
iconStyle: {
|
||||
fontSize: '40rpx',
|
||||
fontWeight: 'bold',
|
||||
color: '#54a966',
|
||||
},
|
||||
scrollTop: 0,
|
||||
}
|
||||
},
|
||||
// contentButtonClick(e) {
|
||||
// console.log(e)
|
||||
// },
|
||||
// onLoad(e) {
|
||||
// //获取一级分类
|
||||
// this.$http
|
||||
// .post('book/shopcategory/getOneLevel')
|
||||
// .then(res => {
|
||||
// this.oneLevel = res.list
|
||||
// this.current = e.type
|
||||
// this.getTowLevel(this.oneLevel[e.type])
|
||||
// })
|
||||
// },
|
||||
//页面显示
|
||||
onShow() {
|
||||
this.getOneLevel()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
mounted () {
|
||||
setTimeout(() => { // 解决vant-tab组件官方问题:底部条位置错误
|
||||
this.utabs = true
|
||||
}, 200)
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
// 获取一级分类
|
||||
getOneLevel() {
|
||||
this.$http
|
||||
.post('book/shopcategory/getOneLevel')
|
||||
.then(res => {
|
||||
//console.log(res,'一级分类')
|
||||
this.oneLevel = res.list
|
||||
// this.current = e.type
|
||||
this.getTowLevel(this.oneLevel[0])
|
||||
})
|
||||
},
|
||||
// 点击一级分类
|
||||
getTowLevel(e) {
|
||||
this.utabs = false
|
||||
// this.twocurrent = 0;
|
||||
uni.showLoading()
|
||||
this.$http
|
||||
.post(`book/shopcategory/getTwoLevel?catId=${e.catId}`)
|
||||
.then(res => {
|
||||
//console.log(res,'二级分类')
|
||||
this.towLevel = res.list
|
||||
if (this.towLevel == '') {
|
||||
this.commodityList = []
|
||||
} else {
|
||||
let newo = {
|
||||
catId:0,
|
||||
name:'全部',
|
||||
parentCid:e.catId
|
||||
}
|
||||
this.towLevel.splice(0,0,newo)
|
||||
// this.getCategoryList(res.list[0])
|
||||
// console.log(this.towLevel, 'towLevel')
|
||||
this.getCategoryList(res.list[0])
|
||||
}
|
||||
uni.hideLoading()
|
||||
this.utabs = true
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
|
||||
// 点击二级分类
|
||||
getCategoryList(e) {
|
||||
// console.log(e)
|
||||
// return false
|
||||
// this.highlight = index
|
||||
this.$http
|
||||
.post('book/shopproduct/appGetCategoryList', {
|
||||
'catId': e.catId
|
||||
})
|
||||
.then(res => {
|
||||
// console.log(res,'二级分类')
|
||||
this.commodityList = res.list
|
||||
})
|
||||
},
|
||||
// 加入购物车
|
||||
addShopCar(e) {
|
||||
this.$http
|
||||
.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`)
|
||||
.then(res => {
|
||||
// 获得用户的购物车列表信息
|
||||
this.cartList = res.cartList
|
||||
// 统计商品信息
|
||||
let data = {
|
||||
"userId": this.userInfo.id,
|
||||
"productId": e.productId,
|
||||
"productAmount": 1,
|
||||
"price": e.price
|
||||
}
|
||||
// 判断列表是否为空
|
||||
if (this.cartList.length > 0) {
|
||||
let flag = ''
|
||||
let shagnpin = {}
|
||||
// 循环购物车列表
|
||||
flag = this.cartList.some((item, index) => {
|
||||
if (item.productId == data.productId) {
|
||||
shagnpin = item
|
||||
shagnpin.productAmount = item.productAmount + 1
|
||||
return true
|
||||
}
|
||||
})
|
||||
if (flag) {
|
||||
// 已在购物车中添加
|
||||
$http.request({
|
||||
url: "book/ordercart/update",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: shagnpin,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
// 加入购物车
|
||||
$http.request({
|
||||
url: "book/ordercart/save",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
// 购物车列表为空时直接加入购物车
|
||||
$http.request({
|
||||
url: "book/ordercart/save",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title: '加入购物车成功',
|
||||
duration: 1000,
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 商品内容跳转
|
||||
toDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: `./commodityDetail?id=${id}`
|
||||
})
|
||||
}
|
||||
},
|
||||
onPullDownRefresh(){
|
||||
// console.log('refresh');
|
||||
this.commodityList = []
|
||||
this.getOneLevel()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.publierInfo {
|
||||
display: inline-block;
|
||||
background-color: #f1f1f1;
|
||||
flex-direction: row;
|
||||
border-radius: 10px;
|
||||
vertical-align: middle;
|
||||
padding: 0 12rpx;
|
||||
line-height: 32rpx;
|
||||
}
|
||||
|
||||
.c999 {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.f24 {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.search_box {
|
||||
width: 90%;
|
||||
height: 64upx;
|
||||
background-color: #fff;
|
||||
border-radius: 32upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0upx 40upx;
|
||||
position: relative;
|
||||
margin: 30rpx 0 15rpx -46%;
|
||||
left: 50%;
|
||||
box-shadow: 0 0px 10px 1px #54a96633;
|
||||
|
||||
.prompt {
|
||||
color: #cccccc;
|
||||
|
||||
}
|
||||
|
||||
.icon_search {
|
||||
background-image: url('@/static/icon/map_ic_search.png');
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
width: 29upx;
|
||||
height: 28upx;
|
||||
margin-right: 20upx;
|
||||
}
|
||||
}
|
||||
|
||||
.oneBox {
|
||||
margin: 10rpx auto;
|
||||
|
||||
.oneLevel {}
|
||||
}
|
||||
|
||||
.twoBox {
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.classfyBody {
|
||||
margin: 5rpx auto;
|
||||
// width: 100%;
|
||||
height: 100%;
|
||||
|
||||
|
||||
|
||||
.towLevel {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
|
||||
.towLevelTitle {
|
||||
width: 28%;
|
||||
height: auto;
|
||||
text-align: center;
|
||||
|
||||
.titleItem {
|
||||
font-size: 35rpx;
|
||||
padding: 20rpx 10rpx;
|
||||
}
|
||||
|
||||
.active {
|
||||
background-color: #fff;
|
||||
border-left: solid 10rpx #eba00b;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.towLevelContent {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 10rpx 20rpx;
|
||||
width: 100%;
|
||||
align-items: stretch;
|
||||
// align-content:center;
|
||||
align-content:start;
|
||||
.commodityItem {
|
||||
width: 50%;
|
||||
// background-color: #fff;
|
||||
padding: 10rpx;
|
||||
|
||||
.box {
|
||||
background-color: #fff;
|
||||
padding: 10rpx;
|
||||
border-radius: 20rpx !important;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0px 10px 1px #54a96633;
|
||||
}
|
||||
|
||||
.commodityTitle {
|
||||
font-size: 32rpx;
|
||||
margin: 20rpx 0 10rpx 0;
|
||||
}
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
border-radius: 10rpx;
|
||||
height: 300rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.commodityContent {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.commodityPrice {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
margin: 0 0 3rpx 0;
|
||||
|
||||
.price {
|
||||
vertical-align: middle;
|
||||
color: #ffa200;
|
||||
|
||||
.priceTag {
|
||||
flex-direction: row;
|
||||
color: #999;
|
||||
display: inline-block;
|
||||
zoom: .8;
|
||||
margin-left: 6rpx;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.SoldNumber {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
float: right;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.icon {
|
||||
background-color: #fbf6ec;
|
||||
border-radius: 50rpx;
|
||||
padding: 5rpx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: -20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
78
pages/bookShop/classifyAll.vue
Normal file
78
pages/bookShop/classifyAll.vue
Normal file
@@ -0,0 +1,78 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar title="全部分类"></z-nav-bar>
|
||||
<view class="oneLevel">
|
||||
<view class="oneItem" v-for="(item,index) in oneLevel" @click="getTowLevel(index)">
|
||||
<image :src="item.icon"></image>
|
||||
<text>{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
oneLevel: [],
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.$http
|
||||
.post('book/shopcategory/getOneLevel')
|
||||
.then(res => {
|
||||
let arr = []
|
||||
for (let i in res.list) {
|
||||
arr.push({
|
||||
icon: "../../static/icon/shop_bar_" + (Number(i) + Number(1)) + ".png",
|
||||
name: res.list[i].name,
|
||||
catId: res.list[i].catId
|
||||
})
|
||||
}
|
||||
this.oneLevel = arr
|
||||
})
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
// 点击分类跳转
|
||||
getTowLevel(e) {
|
||||
uni.navigateTo({
|
||||
url: `./classify?type=${e}`
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.oneLevel {
|
||||
|
||||
margin: 10rpx 0 0 0;
|
||||
|
||||
|
||||
.oneItem {
|
||||
display: inline-block;
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
margin: 30rpx 0 0 0;
|
||||
|
||||
image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
1301
pages/bookShop/commodityDetail.vue
Normal file
1301
pages/bookShop/commodityDetail.vue
Normal file
File diff suppressed because it is too large
Load Diff
284
pages/bookShop/commoditySearch.vue
Normal file
284
pages/bookShop/commoditySearch.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar>
|
||||
<u-search :clearabled="true" bgColor="#fff" borderColor="#54a966" focus v-model="bookScreen.bookName"
|
||||
@custom='souBook' @clear="clear"></u-search>
|
||||
</z-nav-bar>
|
||||
<view class="sear_ch" v-if="this.show==0">
|
||||
<view class="sear_ch_tit">
|
||||
历史搜索
|
||||
</view>
|
||||
<view class="sear_ch_tag">
|
||||
<text v-for="item in historyList" @click="serkeyWord(item)">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sear_class" v-if="this.show==1">
|
||||
<view class="sc_xuan">
|
||||
<view class="sc_con" v-for="(item,index) in classFen" @click="FenBook(item)"
|
||||
:class="bookScreen.type == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
|
||||
</view>
|
||||
<view class="sc_xuan">
|
||||
<view class="sc_con" v-for="(item,index) in classMian" @click="MianBook(item)"
|
||||
:class="bookScreen.is_charge == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sear_list" v-if="this.show==1">
|
||||
<view class="bl_tioa" v-for="(item,index) in bookList" @click="onBookJump(item)">
|
||||
|
||||
</view>
|
||||
<view style="height: 1px;"></view>
|
||||
<view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
<u-loading-icon style="display: inline-block;"></u-loading-icon>
|
||||
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view v-if="this.show==1&&this.bookList==''">
|
||||
<u-divider text="暂无数据"></u-divider>
|
||||
</view>
|
||||
<view style="padding-bottom: 20rpx;">
|
||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||
</view>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
scrollTop: 0,
|
||||
totalPage: 0,
|
||||
status: 3,
|
||||
show: 0,
|
||||
bookList: [],
|
||||
historyList: [],
|
||||
bookScreen: {
|
||||
authorName: '', //作者
|
||||
publisherName: '', //出版社
|
||||
type: '', //电子书类型
|
||||
bookName: '', //关键词
|
||||
is_charge: 1, //是否收费(0收费1免费)
|
||||
state: 1,
|
||||
page: 1, //当前页码数
|
||||
limit: 10, //单页数据数量
|
||||
},
|
||||
classFen: [{
|
||||
sort: '全部',
|
||||
id: ''
|
||||
}, {
|
||||
sort: '医学',
|
||||
id: 1
|
||||
}, {
|
||||
sort: '国学',
|
||||
id: 2
|
||||
}, {
|
||||
sort: '文学',
|
||||
id: 3
|
||||
}, {
|
||||
sort: '古籍',
|
||||
id: 4
|
||||
}],
|
||||
classMian: [{
|
||||
sort: '免费',
|
||||
id: 1
|
||||
}, {
|
||||
sort: 'VIP',
|
||||
id: 0
|
||||
}],
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
// 返回顶部
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onReachBottom() {
|
||||
this.status = 0
|
||||
if (this.bookScreen.page < this.totalPage) {
|
||||
this.bookScreen.page = this.bookScreen.page + 1
|
||||
setTimeout(() => {
|
||||
this.$http
|
||||
.post('book/book/list', this.bookScreen)
|
||||
.then(res => {
|
||||
this.totalPage = res.page.totalPage
|
||||
for (let i in res.page.list) {
|
||||
this.bookList.push(res.page.list[i])
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
} else {
|
||||
this.status = 1
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
this.getHistory()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
// 获取缓存
|
||||
getHistory() {
|
||||
this.historyList = uni.getStorageSync('hisRecords')
|
||||
if (this.historyList.length > 10) {
|
||||
this.historyList.splice(10, this.historyList.length)
|
||||
uni.setStorageSync('hisRecords', this.historyList);
|
||||
}
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getData() {
|
||||
this.$http
|
||||
.post('book/book/list', this.bookScreen)
|
||||
.then(res => {
|
||||
this.bookList = res.page.list
|
||||
this.totalPage = res.page.totalPage
|
||||
this.status = 3
|
||||
this.show = 1
|
||||
});
|
||||
},
|
||||
|
||||
// 清空
|
||||
clear() {
|
||||
this.show = 0
|
||||
this.getHistory()
|
||||
},
|
||||
|
||||
// 搜索
|
||||
souBook() {
|
||||
if (this.bookScreen.bookName == '') {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入关键字'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.getData();
|
||||
|
||||
let ArryList = []
|
||||
if (uni.getStorageSync('hisRecords') == '') {
|
||||
ArryList.push(this.bookScreen.bookName)
|
||||
uni.setStorageSync('hisRecords', ArryList);
|
||||
} else {
|
||||
let value = uni.getStorageSync('hisRecords')
|
||||
value.unshift(this.bookScreen.bookName)
|
||||
uni.setStorageSync('hisRecords', value);
|
||||
}
|
||||
},
|
||||
|
||||
// 点击历史搜索
|
||||
serkeyWord(e) {
|
||||
this.bookScreen.bookName = e
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.sear_ch {
|
||||
margin: 50rpx 40rpx 0 40rpx;
|
||||
|
||||
.sear_ch_tit {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 0 0;
|
||||
}
|
||||
|
||||
.sear_ch_tag {
|
||||
margin: 20rpx 0 0 0;
|
||||
|
||||
text {
|
||||
background-color: #eee;
|
||||
font-size: 24rpx;
|
||||
border-radius: 50rpx;
|
||||
display: inline-block;
|
||||
margin: 0 30rpx 20rpx 0;
|
||||
padding: 10rpx 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sear_class {
|
||||
margin: 20rpx 30rpx 60rpx 30rpx;
|
||||
|
||||
.sc_xuan {
|
||||
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.sc_con {
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
}
|
||||
|
||||
.sc_con_style {
|
||||
color: #27b386;
|
||||
background-color: #2ab58833;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sear_list {
|
||||
margin: 50rpx 30rpx 0 30rpx;
|
||||
|
||||
.bl_tioa {
|
||||
box-shadow: 0 0px 10px 1px #d3d1d133;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
padding: 0 25upx 10upx 220upx;
|
||||
margin: 0 0 60rpx 0;
|
||||
border-radius: 15rpx;
|
||||
min-height: 250rpx;
|
||||
|
||||
view {
|
||||
|
||||
text {
|
||||
color: #9b9b9b;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.bok_name {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
image {
|
||||
position: absolute;
|
||||
left: 30upx;
|
||||
top: -20upx;
|
||||
width: 160upx;
|
||||
height: 240upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
263
pages/bookShop/deliverDetail.vue
Normal file
263
pages/bookShop/deliverDetail.vue
Normal file
@@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<view class="header">
|
||||
<!-- 顶部导航栏 -->
|
||||
<z-nav-bar title="物流详情"></z-nav-bar>
|
||||
</view>
|
||||
<view class="" style="margin-bottom: 20rpx; font-size: 28rpx;">
|
||||
<view class="kuaidiItem">运单号: {{expressOrderSn}}
|
||||
<u-tag @click="copyData(expressOrderSn)" class="copyCode" text="复制" plain type="success" /></view>
|
||||
</view>
|
||||
<view v-if="deliverDetails.length > 0">
|
||||
<!-- <u-tabs active-color="#2979ff" inactive-color="#606266" bar-height="6" bar-width="40"
|
||||
name="name" :list="deliverList" :is-scroll="false" :current="current" @change="tabchange"></u-tabs> -->
|
||||
<view class="deliverCntent">
|
||||
<view class="">
|
||||
|
||||
<view v-for="(item, index) in deliverDetails" :class="['item',index == 0 ? 'first':'' ]">
|
||||
<view class="flexbox">
|
||||
<view class="img_icon "></view>
|
||||
<view class="wuliu">
|
||||
<view class="time">{{item.acceptTime}}</view>
|
||||
<view class="content">{{item.acceptStation}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="quesheng" v-else>
|
||||
<u-divider text="- 暂无物流信息 -"></u-divider>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
<public-module></public-module>
|
||||
<!-- <u-loading color="red" :show="loading"></u-loading> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
// import Loading from '../../'
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
import loginVue from '../user/login.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
loading: false,
|
||||
orderId: null,
|
||||
deliverDetails: [],
|
||||
express:{}, // 面单
|
||||
consignee:{}, // 收件人信息
|
||||
expressOrderSn:'', // 运单号
|
||||
// expressCompanyCode:'', //快递编码
|
||||
// expressCompanyName:'' ,// 快递公司
|
||||
orderSn : '',
|
||||
current: 0,
|
||||
deliverList: [],
|
||||
deliverDetailsLength: null,
|
||||
orderContet:{},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.expressOrderSn = e.expressOrderSn
|
||||
// this.expressCompanyCode = e.expressCompanyCode
|
||||
// this.expressCompanyName = e.expressCompanyName
|
||||
//this.express = e.express
|
||||
//this.consignee = e.consignee
|
||||
console.log(e,'传入的参数')
|
||||
this.orderSn = e.orderSn
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderList()
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取订单列表
|
||||
getOrderList() {
|
||||
console.log('this.orderType',this.orderType)
|
||||
this.$http
|
||||
// .get(`book/buyOrder/getOrderInfo?orderId=${this.orderID}`)
|
||||
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
|
||||
.then(res => {
|
||||
console.log('订单详情',res)
|
||||
var seconds = res.result.timestamp + 30 * 60 + 2 // 过期时间
|
||||
var nowSeconds = Math.floor(new Date().getTime() / 1000);
|
||||
res.result.overTime = seconds - nowSeconds
|
||||
|
||||
this.orderContet = res.result
|
||||
//this.userRecordid = res.userRecordid
|
||||
this.productIDs = res.result.goodsList.map(item => {
|
||||
return item.buyOrderProductId
|
||||
})
|
||||
// console.log(this.orderContet,'this.orderContet')
|
||||
if (this.orderContet.orderStatus == 0) {
|
||||
this.titleStat = '待支付'
|
||||
} else if (this.orderContet.orderStatus == 1) {
|
||||
this.titleStat = '待发货'
|
||||
} else if (this.orderContet.orderStatus == 2) {
|
||||
this.titleStat = '待收货'
|
||||
} else if (this.orderContet.orderStatus == 3) {
|
||||
this.titleStat = '已完成'
|
||||
}
|
||||
|
||||
|
||||
if(parseInt(this.orderContet.orderStatus) >= 2){
|
||||
this.getdeliverDetails()
|
||||
// 查询快递信息
|
||||
// this.getSheetInfo()
|
||||
}
|
||||
console.log(this.orderContet,'订单详情')
|
||||
})
|
||||
},
|
||||
|
||||
// 复制到剪切板
|
||||
copyData(data){
|
||||
uni.setClipboardData({
|
||||
data,
|
||||
success: function () {
|
||||
console.log('success');
|
||||
}
|
||||
});
|
||||
},
|
||||
tabchange(item) {
|
||||
console.log(item)
|
||||
this.current = item.index
|
||||
},
|
||||
// 获取物流
|
||||
getdeliverDetails() {
|
||||
this.deliverList = []
|
||||
// var strLength = this.orderContet.consignee.consigneeMobile.length
|
||||
// var subMobile = this.orderContet.consignee.consigneeMobile.substring(strLength-4,strLength)
|
||||
// this.expressOrderSn = 'SF1504651506851'
|
||||
// this.expressCompanyCode = 'SF'
|
||||
// subMobile = '9277'
|
||||
uni.showLoading()
|
||||
this.$http
|
||||
//.post(`/book/buyOrder/queryFMS?orderId=${this.orderId}`)
|
||||
.get(`/book/buyOrder/searchExpress?expressOrderSn=${this.expressOrderSn}`)
|
||||
.then(res => {
|
||||
console.log(res, '物流信息')
|
||||
if (res && res.code === 0) {
|
||||
uni.hideLoading()
|
||||
// this.deliverDetails = res.result.traces
|
||||
console.log(res.express.traces,'物流信息')
|
||||
if(res.express.traces.length > 0){
|
||||
this.deliverDetails = res.express.traces.reverse()
|
||||
}else{
|
||||
this.deliverDetails = []
|
||||
}
|
||||
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.hideLoading()
|
||||
console.log(e,'e')
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.item:first-child::before {
|
||||
background-color: #6fca78 !important
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.quesheng{text-align: center; margin-top: 20px;
|
||||
image{ width: 150rpx; height: 170rpx; display: block; margin: 10px auto;
|
||||
}
|
||||
text{
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
.copyCode{display: inline-block; margin-left: 20rpx; }
|
||||
.u-tabs {
|
||||
background: #fff
|
||||
}
|
||||
|
||||
.xiangqing {
|
||||
overflow: hidden;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.kuaidiItem {
|
||||
padding: 10px;
|
||||
color: #666
|
||||
}
|
||||
|
||||
.deliverCntent {
|
||||
.img_icon {
|
||||
border-left: 2px solid #eee;
|
||||
}
|
||||
line-height:20px;
|
||||
padding: 32rpx;
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
border-top: 1px solid #eee;
|
||||
font-size: 28rpx;
|
||||
color:#777;
|
||||
.item {
|
||||
padding-left: 10px;
|
||||
position: relative;
|
||||
}
|
||||
.item:before {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 100%;
|
||||
background: #eee;
|
||||
left: 6px;
|
||||
top: 0;
|
||||
content: "";
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: #888;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 5px
|
||||
}
|
||||
.first{
|
||||
color: #55aa7f;
|
||||
}
|
||||
.content {
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
}
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.img_icon {
|
||||
padding-right: 30rpx;
|
||||
}
|
||||
|
||||
.moreBtnF {
|
||||
align-items: center;
|
||||
padding: 30rpx;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background-color: rgba(255, 255, 255, .9);
|
||||
}
|
||||
</style>
|
||||
22
pages/bookShop/deliverLIst.vue
Normal file
22
pages/bookShop/deliverLIst.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
快递列表页面
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
1047
pages/bookShop/orderLCont.vue
Normal file
1047
pages/bookShop/orderLCont.vue
Normal file
File diff suppressed because it is too large
Load Diff
848
pages/bookShop/orderList.vue
Normal file
848
pages/bookShop/orderList.vue
Normal file
@@ -0,0 +1,848 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<view class="header">
|
||||
<!-- 顶部导航栏 -->
|
||||
<z-nav-bar backState="2000" title="我的订单"></z-nav-bar>
|
||||
<view class="ordersTabs">
|
||||
<view v-for="(item,index) in ordersTabs" @click="ordersTabCLi(item.value)" :key="index"
|
||||
:class="ordersListTab==item.value?'ordersdefine ordStyle':'ordersdefine'">
|
||||
{{item.name}}
|
||||
<view class="ordersnum" v-if="item.value == 0 && map[item.value] > 0">{{map[item.value]}}</view>
|
||||
<view class="ordersnum" v-if="item.value == 1 && map[item.value] > 0">{{map[item.value]}}</view>
|
||||
<view class="ordersnum" v-if="item.value == 2 && map[item.value] > 0">{{map[item.value]}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 站位 -->
|
||||
<view class="ordersTabs" style="z-index:0;position:unset;">
|
||||
<view class="ordersdefine">1</view>
|
||||
</view>
|
||||
<!-- <view v-if="ordersListTab == 1"> -->
|
||||
<view>
|
||||
<view v-if="newList.length > 0">
|
||||
<view class="orderInfo" v-for="(item,index) in newList" :key="index">
|
||||
<view class="mainContent">
|
||||
<view class="item" @click.stop="toDetail(item)">
|
||||
<view class="orderstatus" v-show="item.orderStatus == 0">未付款</view>
|
||||
<view class="orderstatus" v-show="item.orderStatus == 1">待发货</view>
|
||||
<view class="orderstatus" v-show="item.orderStatus == 2">已发货</view>
|
||||
<view class="orderstatus" v-show="item.orderStatus == 3">交易成功</view>
|
||||
<view class="orderstatus" v-show="item.orderStatus == 4">交易失败</view>
|
||||
<view class="orderstatus" v-show="item.orderStatus == 5">过期</view>
|
||||
<view v-for="(item1,index1) in item.productList" :key="index1" class="bookinfolist">
|
||||
<image class="feng" v-if="item1.product.productImages" :src="item1.product.productImages" mode="aspectFill"></image>
|
||||
<!-- <view class="description" v-html="item.content">
|
||||
</view> -->
|
||||
<view class="btns flexbox">
|
||||
<span class="booknameleft">{{item1.product.productName}}</span>
|
||||
<span class="right flexbox opbtns">
|
||||
¥{{item1.product.price}}
|
||||
</span>
|
||||
</view>
|
||||
<view class="btns flexbox" style="margin-top:10rpx;padding-bottom: 72rpx;">
|
||||
<span class="left" style="color: #C0C4CC;"></span>
|
||||
<span class="right flexbox opbtns" style="color: #C0C4CC;">
|
||||
×{{item1.quantity}}
|
||||
</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||
<span class="left" style="color: #C0C4CC;"></span>
|
||||
<span class="right flexbox opbtns">
|
||||
<view style="color: #000;font-size:30rpx;font-weight:700;">实付款</view>
|
||||
<view style="color: #000;font-size:30rpx;font-weight:700;">{{' ¥' + item.realMoney}}</view>
|
||||
</span>
|
||||
</view>
|
||||
<view class="btns flexbox" style="margin-top:10rpx;">
|
||||
<span class="left" style="color: #C0C4CC;" @click.stop="toDetail(item)">订单详情</span>
|
||||
<span class="right flexbox opbtns">
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="canceOrder(item)">取消订单</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 0" @click.stop="goPay(item)">付款</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 1">催发货</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="seeExpressDetail(item)">查看物流</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 2" @click.stop="OverOrder(item)">确认收货</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 3">申请售后</view>
|
||||
<view class="orderstatusbtn" v-if="item.orderStatus == 3 && userRecordid == null" @click.stop="pingji(item.productId)">评价</view>
|
||||
<!-- <view class="orderstatusbtn" v-if="item.orderStatus == 3 && userRecordid != null" @click.stop="showZhuiping(item.productId)">追评</view> -->
|
||||
</span>
|
||||
</view>
|
||||
<view style="border-bottom:2rpx solid #e9e9e9;height:50rpx;" v-if="index<item.length-1"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
<u-loading-icon style="display: inline-block;"></u-loading-icon>
|
||||
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
|
||||
</view>
|
||||
<view v-if="status==1" style="padding-bottom: 20rpx;">
|
||||
<u-divider v-if="newList.length > 0" text="全部加载完成"></u-divider>
|
||||
<u-divider v-else text="暂无订单"></u-divider>
|
||||
</view>
|
||||
|
||||
<!-- 对话框 -->
|
||||
<u-popup :show="pingjiaShow" :round="10" @close="closePingjia">
|
||||
<view class="tanchu" >
|
||||
<view class="dp_title" v-if="pjType != 'zhuiping'">添加评价</view>
|
||||
<view class="dp_title" v-else>添加追评</view>
|
||||
|
||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||
<uni-forms :modelValue="Pform">
|
||||
<!-- 评价图片 -->
|
||||
<!-- end -->
|
||||
<!-- <uni-forms-item name="comment" label-width="0">
|
||||
<uni-easyinput type="textarea" v-model="Pform.comment" placeholder="请输入您的商品评价" />
|
||||
</uni-forms-item> -->
|
||||
</uni-forms>
|
||||
<!-- <u-button type="success" @click="submitPJ">提交评价</u-button> -->
|
||||
<!-- 提交 -->
|
||||
<view class="padding-bottom-sm flex padding-lr-sm" style="border-bottom: 1px solid #EEEEEE;">
|
||||
|
||||
<view class="mb30" v-if="pjType != 'zhuiping'">
|
||||
<span :class="['star',Pform.star>=1 ? 'starLight': 'starGray']" @click="getStar(1)"></span>
|
||||
<span :class="['star',Pform.star>=2 ? 'starLight': 'starGray']" @click="getStar(2)"></span>
|
||||
<span :class="['star',Pform.star>=3 ? 'starLight': 'starGray']" @click="getStar(3)"></span>
|
||||
<span :class="['star',Pform.star>=4 ? 'starLight': 'starGray']" @click="getStar(4)"></span>
|
||||
<span :class="['star',Pform.star>=5 ? 'starLight': 'starGray']" @click="getStar(5)"></span>
|
||||
</view>
|
||||
<view class="mb30" v-if="pjType != 'zhuiping'">
|
||||
<!-- <uni-file-picker :auto-upload="false" ref="files" @delete="deleteImg" limit="5" @success="upSuccess" @select="select" v-model="Pform.img" fileMediatype="image" :image-styles="imageStyles"/> -->
|
||||
<u-upload :fileList="Pform.img" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="4"
|
||||
width="80" height="80" :previewFullImage="true">
|
||||
</u-upload>
|
||||
</view>
|
||||
<view class="flex-sub flexbox">
|
||||
<i @click="showEmj()" :class="emojiIcon" ></i>
|
||||
<!-- <input type="text" @focus="InputFocus" @blur="InputBlur" v-model="message" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></input> -->
|
||||
<textarea class="textarea" v-model="Pform.comment" @focus="InputFocus" @blur="InputBlur" @input="textareaBInput" placeholder-style="font-size:24rpx;color:#aaaaaa;" placeholder="请输入您要发送的内容"></textarea>
|
||||
</view>
|
||||
<view class="">
|
||||
<!-- <button class="cu-btn bg-gradual-blue shadow-blur">发送</button> -->
|
||||
<u-button type="success" @click="submitPJ" v-if="pjType != 'zhuiping'">提交评价</u-button>
|
||||
<u-button type="success" @click="zhuiping" v-else>提交追评</u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="position: relative;">
|
||||
<emotion @emotion="handleEmj" :height="220" v-if="isShowEmj" :windowWidth="windowWidth"></emotion>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<z-navigation></z-navigation>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import emotion from '@/bkhumor-emojiplus/components/bkhumor-emojiplus/bkhumor-emojiplus.vue';
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import {
|
||||
setPay,
|
||||
setPayAssign,setWXPay
|
||||
} from '@/config/utils';
|
||||
import { data } from 'jquery';
|
||||
import {
|
||||
mapState, mapMutations
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// loadingNow : false,
|
||||
playData:{},
|
||||
emojiIcon:'cuIcon-emoji',
|
||||
windowWidth:0,
|
||||
bookid:null,
|
||||
booklistpage: 1,
|
||||
productList:[],
|
||||
productInfo:{},
|
||||
emoji:[],
|
||||
Files:[],
|
||||
page:1,
|
||||
pageSize:10,
|
||||
total:0,
|
||||
status:3,
|
||||
shupingList:[],
|
||||
bfaid:null,
|
||||
ordersTabs: [{
|
||||
name: '全部',
|
||||
value: null
|
||||
}, {
|
||||
name: '待付款',
|
||||
value: 0
|
||||
}, {
|
||||
name: '待发货',
|
||||
value: 1
|
||||
}, {
|
||||
name: '待收货',
|
||||
value: 2
|
||||
}, {
|
||||
name: '已完成',
|
||||
value: 3
|
||||
}],
|
||||
ordersListTab: 1,
|
||||
newestpage: 1,
|
||||
// hotestpage: 1,
|
||||
// booksetpage: 1,
|
||||
newList:[],
|
||||
// hotList:[],
|
||||
// bookList:[],
|
||||
map: {},
|
||||
userRecordid:null, // 用户的评价状态
|
||||
pingjiaShow:false, //添加评价
|
||||
Pform:{ // 评价表单
|
||||
star:0,
|
||||
comment:'',
|
||||
img:[],
|
||||
html:''
|
||||
},
|
||||
isShowEmj: false,
|
||||
pjType:'',
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新了')
|
||||
uni.stopPullDownRefresh();
|
||||
|
||||
this.newestpage = 1
|
||||
// this.hotestpage = 1
|
||||
// this.booksetpage = 1
|
||||
this.newList = []
|
||||
// this.hotList = []
|
||||
// this.bookList = []
|
||||
this.getBookList(this.ordersListTab, false)
|
||||
|
||||
},
|
||||
onReachBottom() {
|
||||
this.newestpage++
|
||||
// this.hotestpage++
|
||||
// this.booksetpage++
|
||||
this.getBookList(this.ordersListTab, false)
|
||||
},
|
||||
onLoad(e) {
|
||||
this.windowWidth = uni.getSystemInfoSync().windowWidth;
|
||||
console.log(e,'onload111')
|
||||
// this.bookid = e.bookid
|
||||
this.getBookList(1, false)
|
||||
},
|
||||
computed:{
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['setLoadingShow']),
|
||||
// 切换tab状态
|
||||
ordersTabCLi(e) {
|
||||
this.ordersListTab = e
|
||||
this.newestpage = 1
|
||||
// this.hotestpage = 1
|
||||
// this.booksetpage = 1
|
||||
this.newList = []
|
||||
// this.hotList = []
|
||||
// this.bookList = []
|
||||
this.getBookList(this.ordersListTab, false)
|
||||
},
|
||||
// 查看本书更多书评
|
||||
toMore(val){
|
||||
console.log(val,'val')
|
||||
uni.navigateTo({
|
||||
url: '../comments/comments?bookid='+val.id,
|
||||
});
|
||||
},
|
||||
// 订单详情
|
||||
toDetail(val){
|
||||
console.log(val,'val')
|
||||
// uni.navigateTo({
|
||||
// url:'../bookShop/commentsDetail?bookid='+val.bookid+'&bfa_id='+val.id
|
||||
// })
|
||||
uni.navigateTo({
|
||||
url: './orderLCont?orderId=' + val.orderId + '&orderType=' + val.orderStatus + '&orderSn=' + val.orderSn
|
||||
});
|
||||
},
|
||||
getBookList(flag, refreshflag){
|
||||
// 根据tab不同,获取最新书评、最热书评、书集列表
|
||||
// uni.showLoading({
|
||||
// title: '加载中'
|
||||
// });
|
||||
|
||||
// 顶部红点数量
|
||||
$http.request({
|
||||
url: "book/buyOrder/getUserOrderStatusNum",
|
||||
method: "POST",
|
||||
data: {
|
||||
"userId": this.userInfo.id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
this.map = res.map
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
|
||||
var params = {
|
||||
"userId": this.userInfo.id,
|
||||
"orderStatus":flag,//传null为全部,订单状态 0-未付款 1-待发货 2-已发货 3-交易成功 4-交易失败 5-过期
|
||||
"limit": 10,
|
||||
"page": this.newestpage
|
||||
}
|
||||
$http.request({
|
||||
url: "book/buyOrder/getUserOrderList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: params,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(res, '内容获取成功')
|
||||
if (res.code == 0 && res.page && res.page.records.length > 0) {
|
||||
this.newList = this.newList.concat(res.page.records)
|
||||
} else { //
|
||||
|
||||
}
|
||||
if(res.page.records.length != 10){
|
||||
this.status = 1
|
||||
} else {
|
||||
this.status = 0
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e)
|
||||
})
|
||||
},
|
||||
// 支付
|
||||
goPay(payItem) {
|
||||
console.log(payItem,'订单数据')
|
||||
if(payItem.paymentMethod == 2){
|
||||
console.log('阿里支付')
|
||||
setPay({
|
||||
typePay: 'alipay',
|
||||
subject: 'order',
|
||||
totalAmount: payItem.realMoney,
|
||||
type: 2,
|
||||
relevanceoid: payItem.orderSn,
|
||||
customerId: this.userInfo.id,
|
||||
}, res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
this.getOrderList()
|
||||
})
|
||||
} else if(payItem.paymentMethod == 1){
|
||||
console.log('微信支付')
|
||||
// console.log(this.isAndorid)
|
||||
if(this.isAndorid == false){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '很抱歉,苹果系统暂不支持微信支付',
|
||||
showCancel:false
|
||||
})
|
||||
return false
|
||||
}else{
|
||||
let data1={
|
||||
orderSn:payItem.orderSn,
|
||||
buyOrderId: null,
|
||||
totalAmount: payItem.realMoney
|
||||
}
|
||||
console.log(data1,'data1')
|
||||
setWXPay(data1,res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
} else {
|
||||
console.log(res)
|
||||
if(res.data.errMsg.indexOf('User canceled') != -1){
|
||||
uni.showToast({
|
||||
title: "用户取消支付",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}else if(payItem.paymentMethod == 3){
|
||||
// 苹果充值
|
||||
console.log('苹果二次支付')
|
||||
if(this.isAndorid){
|
||||
uni.showModal({
|
||||
title:'提示',
|
||||
showCancel:false,
|
||||
content:'很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
|
||||
})
|
||||
}else{
|
||||
this.iphonepay(payItem)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 取消订单
|
||||
canceOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要取消订单吗?',
|
||||
confirmText: "取消订单",
|
||||
cancelText: "考虑一下",
|
||||
confirmColor: '#c96713',
|
||||
cancelColor: '#555',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$http
|
||||
.get('/book/buyOrder/cancelOrder?orderSn=' + item.orderSn)
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '取消订单成功'
|
||||
})
|
||||
// uni.switchTab({
|
||||
// url: './orderList'
|
||||
// });
|
||||
|
||||
this.newestpage = 1
|
||||
this.newList = []
|
||||
this.getBookList(this.ordersListTab, false)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// canceOrder(item) {
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '确定要取消订单吗?',
|
||||
// confirmText: "取消订单",
|
||||
// cancelText: "考虑一下",
|
||||
// confirmColor: '#c96713',
|
||||
// cancelColor: '#555',
|
||||
// success: res => {
|
||||
// if (res.confirm) {
|
||||
// uni.showLoading()
|
||||
// $http.request({
|
||||
// url: "book/buyOrder/cancelOrder",
|
||||
// method: "GET", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
// data,
|
||||
// header: { //默认 无 说明:请求头
|
||||
// 'Content-Type': 'application/json'
|
||||
// },
|
||||
// }).then(res => {
|
||||
// if (res.code == 0) {
|
||||
// uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: '订单已取消',
|
||||
// icon: 'success',
|
||||
// duration: 1000
|
||||
// })
|
||||
// this.getBookList(this.ordersListTab, false)
|
||||
// }
|
||||
// })
|
||||
// } else if (res.cancel) {}
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
// 查看物流
|
||||
seeExpressDetail(item){
|
||||
// console.log(item, this.sheetList.length)
|
||||
// if(this.sheetList.length > 1){
|
||||
// this.sheetListShow = true
|
||||
// }else if(this.sheetList.length == 1){
|
||||
// 直接展示详情
|
||||
uni.navigateTo({
|
||||
url: "./deliverDetail?orderSn=" + item.orderSn + "&expressOrderSn=" + item.expressList[0].expressOrderSn
|
||||
})
|
||||
// }
|
||||
},
|
||||
// 确认收货
|
||||
OverOrder(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认收货?',
|
||||
success: res => {
|
||||
let data = {
|
||||
orderId: item.orderId,
|
||||
orderStatus: '3'
|
||||
}
|
||||
if (res.confirm) {
|
||||
uni.showLoading()
|
||||
$http.request({
|
||||
url: "book/buyOrder/update",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: '收货成功',
|
||||
icon: 'success',
|
||||
duration: 1000
|
||||
})
|
||||
this.newestpage = 1
|
||||
this.newList = []
|
||||
this.getBookList(this.ordersListTab, false)
|
||||
}
|
||||
})
|
||||
} else if (res.cancel) {}
|
||||
}
|
||||
});
|
||||
},
|
||||
closePingjia(){
|
||||
this.pingjiaShow = false
|
||||
this.Pform.comment = ''
|
||||
this.Pform.html = ''
|
||||
this.emoji = []
|
||||
},
|
||||
// 提交评价
|
||||
submitPJ(){
|
||||
if(this.Pform.comment != ''){
|
||||
|
||||
let data={
|
||||
'userid':this.userInfo.id,
|
||||
'orderSn': this.orderSn,
|
||||
'bookid': this.productID,
|
||||
// 'content': this.Pform.html,
|
||||
'content': this.Pform.comment,
|
||||
'starLevel':this.Pform.star,
|
||||
'images':this.Pform.img,
|
||||
// 'emoji':this.emoji // 表情数组
|
||||
}
|
||||
// console.log(data,'data')
|
||||
$http.request({
|
||||
url: "buy/record/UserRecordcomment",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
uni.showToast({
|
||||
title:'评价成功!',
|
||||
icon:'success'
|
||||
})
|
||||
|
||||
this.pingjiaShow = false
|
||||
this.Pform.comment = ''
|
||||
this.Pform.html = ''
|
||||
this.emoji = []
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
},2000)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'请先输入您的评价内容 !',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 添加评价
|
||||
pingji(id){
|
||||
console.log(id)
|
||||
this.pjType = ''
|
||||
this.productID = id
|
||||
this.pingjiaShow = true
|
||||
},
|
||||
getStar(i){
|
||||
this.Pform.star = i
|
||||
},
|
||||
InputBlur(e){
|
||||
|
||||
},
|
||||
InputFocus(e){
|
||||
this.isShowEmj = false;
|
||||
this.emojiIcon = 'cuIcon-emoji';
|
||||
this.$emit('foc')
|
||||
},
|
||||
textareaBInput(e) {
|
||||
console.log(e,'e')
|
||||
this.Pform.comment = e.detail.value
|
||||
/// this.Pform.html = e.detail.value
|
||||
},
|
||||
showEmj() {
|
||||
let bool = !this.isShowEmj;
|
||||
if(bool) {
|
||||
this.emojiIcon = 'cuIcon-keyboard';
|
||||
} else {
|
||||
this.emojiIcon = 'cuIcon-emoji';
|
||||
}
|
||||
|
||||
this.isShowEmj = bool;
|
||||
this.$emit('show')
|
||||
},
|
||||
deletePic() {
|
||||
let that = this
|
||||
that.Pform.img.splice(0, 1)
|
||||
//console.log(that.Pform.img)
|
||||
},
|
||||
afterRead(e) {
|
||||
//console.log(e)
|
||||
let that = this
|
||||
for (var i=0; i< e.file.length; i++) {
|
||||
//console.log(i,e.file[i].url)
|
||||
uni.uploadFile({
|
||||
url: this.$baseUrl + 'oss/fileoss',
|
||||
filePath: e.file[i].url,
|
||||
//files:e.file,
|
||||
name: 'file',
|
||||
formData: {},
|
||||
success: (res) => {
|
||||
that.Pform.img.push({
|
||||
url: JSON.parse(res.data).url
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获得输入的表情数组
|
||||
handleEmj(i) {
|
||||
console.log(i,'i---------');
|
||||
this.inputValue = i
|
||||
// console.log(this.inputValue);
|
||||
if(i.emotioni == '[em_98]') {
|
||||
//匹配最后一个表情符号并删除11。
|
||||
this.Pform.comment = this.Pform.comment.replace(/(\[[^\]]+\]|[\s\S])$/, '');
|
||||
if(this.emoji.length > 0){
|
||||
this.emoji = this.emoji.slice(0,-1)
|
||||
}
|
||||
} else {
|
||||
this.emoji.push({'tag' : i.emotion, 'name':i.emotioni})
|
||||
// console.log(this.emoji,'this.emoji')
|
||||
this.Pform.comment += i.emotioni;
|
||||
/// this.Pform.html += i.emotion
|
||||
}
|
||||
},
|
||||
},
|
||||
components:{
|
||||
musicPlay,
|
||||
emotion
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// @import '@/style/mixin.scss';
|
||||
.ordersTabs {
|
||||
// margin: 70rpx 0 0 0;
|
||||
width: 730rpx;
|
||||
// padding: 0 3% 3% 3%;
|
||||
position: fixed;
|
||||
// top: 80rpx;
|
||||
background-color: #f7faf9;
|
||||
z-index: 100;
|
||||
|
||||
.ordersdefine {
|
||||
display: inline-block;
|
||||
padding: 20rpx 0 20rpx 0;
|
||||
// margin: 40rpx 0 15rpx 0;
|
||||
width:140rpx;
|
||||
text-align: center;
|
||||
font-size: 30rpx;
|
||||
position: relative;
|
||||
.ordersnum{
|
||||
position: absolute;
|
||||
top: 8rpx;
|
||||
right: 0rpx;
|
||||
background-color: red;
|
||||
// border:1rpx solid #a3a3a3;
|
||||
border-radius: 40rpx;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
font-size: 20rpx;
|
||||
font-weight: 500;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
}
|
||||
|
||||
.ordStyle {
|
||||
// border-bottom: 4rpx solid #54a966;
|
||||
// color: #54a966;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.orderstatusbtn{
|
||||
color: #000;
|
||||
border:1px solid #999;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
margin-left:20rpx;
|
||||
width:140rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.flexbox{display: flex;}
|
||||
.container{padding: 0 10px;}
|
||||
.star{display: inline-block; width: 20px; height: 20px; margin-right: 10rpx;}
|
||||
.starGray{ background : url(../../static/icon/star_greey.png) no-repeat; background-size: contain; }
|
||||
.starLight{ background : url(../../static/icon/star_light.png) no-repeat; background-size: contain;}
|
||||
.cuIcon-emoji {
|
||||
background : url(../../static/biaoqing.png) no-repeat; background-size: contain; display: block; margin-right: 20rpx;
|
||||
width: 30px; }
|
||||
.cuIcon-keyboard{background : url(../../static/biaoqing.png) no-repeat; background-size: contain; display: block;
|
||||
width: 30px; }
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
|
||||
|
||||
.dp_title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 50rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_add {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
right: 30rpx;
|
||||
font-size: 22rpx;
|
||||
background-color: #fd6004;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
|
||||
.u-icon {
|
||||
display: inline-block;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}}
|
||||
|
||||
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91; padding-bottom: 20rpx; padding-top: 20rpx;}
|
||||
.gengduoshuping{text-align: right; color: #0044ff; padding-bottom: 20rpx; padding-top: 20rpx;}
|
||||
.orderInfo{
|
||||
justify-content: space-between;
|
||||
// margin-bottom: 15px;
|
||||
background-color: #fff;
|
||||
padding:20rpx;
|
||||
border: 1px splid #999;
|
||||
box-sizing: border-box;
|
||||
// padding-bottom: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.bookinfolist{
|
||||
height: 180rpx;
|
||||
}
|
||||
}
|
||||
.mainContent{
|
||||
background-color: #fff;
|
||||
.item{
|
||||
// padding: 10px;
|
||||
// margin-bottom: 30rpx;
|
||||
// border: 1px solid #999;
|
||||
box-sizing: border-box;
|
||||
// padding-bottom: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
// margin-bottom: 20rpx;
|
||||
}
|
||||
.feng{
|
||||
margin:0rpx 20rpx 0 0;
|
||||
height: 160rpx;
|
||||
width: 140rpx;
|
||||
float:left;
|
||||
border-radius: 20rpx;
|
||||
border:1rpx solid #e9e9e9;
|
||||
}
|
||||
.orderstatus{font-size: 30rpx; color: red; text-align: right;padding-bottom: 10rpx;}
|
||||
/deep/.description{
|
||||
overflow: hidden;
|
||||
color: #666;
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 5;
|
||||
line-clamp: 5;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 26rpx;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top:10rpx;
|
||||
height: 172rpx;
|
||||
img{
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
.btns{
|
||||
font-size: 28rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.booknameleft{
|
||||
width: 372rpx;
|
||||
color: #000000;
|
||||
}
|
||||
.left{
|
||||
width: 300rpx;
|
||||
color: #a1a1a1;
|
||||
}
|
||||
.right{
|
||||
width: 350rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
.gzicon{
|
||||
margin:0 0 0 20rpx;
|
||||
height: 40rpx;
|
||||
width: 40rpx;
|
||||
// float:left;
|
||||
// border-radius: 20rpx;
|
||||
// border:1rpx solid #e9e9e9;
|
||||
}
|
||||
.opbtns{
|
||||
.pingjia{margin-left: 10px;}
|
||||
}
|
||||
}
|
||||
}
|
||||
.mb30{margin-bottom: 30rpx; overflow: hidden;}
|
||||
|
||||
.mytabs {
|
||||
// background: url('@/static/icon/bgtushu.png') no-repeat left top;
|
||||
height: 80rpx;
|
||||
// margin-bottom: 30rpx;
|
||||
|
||||
.item {
|
||||
border-radius: 10rpx;
|
||||
background-color: #c6ead0;
|
||||
width: 48%;
|
||||
// margin: 0 10rpx;
|
||||
text-align: center;
|
||||
color: #3c7f56;
|
||||
font-size: 36rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
|
||||
.item.active {
|
||||
background-color: #3c7f56;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.item1 {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1099
pages/bookShop/settlement.vue
Normal file
1099
pages/bookShop/settlement.vue
Normal file
File diff suppressed because it is too large
Load Diff
1080
pages/bookShop/settlementBook.vue
Normal file
1080
pages/bookShop/settlementBook.vue
Normal file
File diff suppressed because it is too large
Load Diff
90
pages/peanut/aboutUs.vue
Normal file
90
pages/peanut/aboutUs.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<view>
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="关于我们"></z-nav-bar>
|
||||
|
||||
<view class="APPinfo">
|
||||
<image src="../../static/icon/fengziIcon.jpg" mode="" style="height: 150rpx; width: 150rpx; margin: 0 auto;"></image><br/>
|
||||
<p>版本信息:{{versionName}},{{versionCode}}</p>
|
||||
</view>
|
||||
|
||||
<view class="telInfo">
|
||||
<view class="nav_list flexbox">
|
||||
<text>客服热线</text>
|
||||
<view class="view1">
|
||||
<text>022-24142321</text>
|
||||
<image @click="makeTel" src="../../static/icon/tel.png" mode="" style="height: 46rpx; width: 46rpx; margin-bottom: -10rpx; display: inline-block; "></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="prof">
|
||||
<p>一款线上电子书APP,包含医学类、国学类、文学类、中医古籍等各种类型。3D仿真翻页、护眼模式等阅读技术,打造舒适阅读体验。图文混排,AI人声读书听书。部分电子书也有对应的纸质书,给予用户更多的阅读选择。</p>
|
||||
</view>
|
||||
<view class="" style="text-align: center;">
|
||||
<!-- https://main.nuttyreading.com/privacy.html -->
|
||||
<!-- <text @click="seeDetail('')" style="color: #007aff; font-size: 26rpx;">隐私政策</text> -->
|
||||
<uni-link href="https://main.nuttyreading.com/privacy.html" text="隐私政策"></uni-link>
|
||||
<!-- <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/"></uni-link> -->
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
versionCode:null,
|
||||
versionName:null
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAppInfo()
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
// 获取版本信息
|
||||
getAppInfo(){
|
||||
let that = this
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
that.versionCode = inf.version
|
||||
that.versionName = inf.name
|
||||
// console.log(that.versionCode,555)
|
||||
});
|
||||
},
|
||||
makeTel(){
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '微信号:yilujiankangkefu',
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// uni.makePhoneCall({
|
||||
// phoneNumber: '022-24142321' //仅为示例
|
||||
// });
|
||||
// } else if (res.cancel) {
|
||||
|
||||
// }
|
||||
// }
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.prof{padding: 20rpx; color: #666; font-size: 24rpx; line-height: 40rpx; text-indent: 2em;}
|
||||
.telInfo{background-color:#fff;
|
||||
.nav_list{padding: 30upx 0 30upx 20upx; border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5; justify-content: space-between; color: #666;
|
||||
.view1{width:300rpx;}
|
||||
}
|
||||
}
|
||||
.APPinfo{background-color:#fff; padding: 40rpx 0; margin-top: 20rpx; text-align: center;
|
||||
p{font-size: 28rpx;}
|
||||
}
|
||||
.flexbox{display: flex; justify-content: center;}
|
||||
</style>
|
||||
831
pages/peanut/bookshelf.vue
Normal file
831
pages/peanut/bookshelf.vue
Normal file
@@ -0,0 +1,831 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar backState="2000" title="我的书架"></z-nav-bar>
|
||||
|
||||
<view v-if="this.bookData.length==0" style="margin-top: 250rpx;text-align: center;font-size: 30rpx;">暂无书籍</view>
|
||||
|
||||
<!-- 弹窗 -->
|
||||
<view class="more-shade" v-if="moreOff" @click.stop="moreOff = false">
|
||||
<view class="more">
|
||||
<view class="more-list more-underline" @click.stop="examine">查看详情</view>
|
||||
<view class="more-list more-underline remove" @click.stop="shiftOut">移出</view>
|
||||
<view class="more-list" @click.stop="moreOff =false">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bookrack-body" :class="{'bookrack-active' :checkboOff}">
|
||||
<view class="book-top">
|
||||
<view class="top-left" v-if="this.bookData.length!=0">
|
||||
<view class="top-btn" v-if="!checkboOff" @click="managementBtn">
|
||||
<view>管理</view>
|
||||
</view>
|
||||
<view class="top-btn" v-if="checkboOff" @click="accomplish">
|
||||
完成
|
||||
</view>
|
||||
</view>
|
||||
<!-- 搜索按钮 -->
|
||||
<!-- <view class="top-right">
|
||||
<view class="input-cancel" v-if="searchOff">
|
||||
<view class="cancel-left">
|
||||
<input class="uni-input" confirm-type="search" maxlength="50" placeholder="请输入关键词搜索" />
|
||||
|
||||
</view>
|
||||
<view class="cancel-right">
|
||||
<view class="top-btn" @click="cancelBtn">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="top-btn" v-if="!checkboOff && !searchOff" @click="searchBtn">
|
||||
|
||||
<span class="icon_search"></span>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="book-rack">
|
||||
<view style="text-align: right;font-size: 28rpx;margin: 20rpx;color: #5a5a5a;">共{{bookData.length}}本</view>
|
||||
<view class="book-card" v-for="(item,index) in bookData" :key="index"
|
||||
@click="bookCardBtn($event,index,'bookHeight' + index,item)" @longtap="managementBtn"
|
||||
ref="bookcard">
|
||||
<view class="book-checkbox" v-if="checkboOff">
|
||||
<view class="checkboxcard" :class="{'checkboxactiva':item.checked}">
|
||||
<view v-if="item.checked" class="check"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="image-text" :id="'bookHeight' + index">
|
||||
<view class="ripple" v-if="index == bookNum" :style="{ top: leftY + 'px', left: topX + 'px' }">
|
||||
</view>
|
||||
<view class="book-left">
|
||||
<image class="book-img" :src="item.image"></image>
|
||||
</view>
|
||||
<view class="book-right">
|
||||
<view class="flex book-text">
|
||||
<view class="head">{{item.bookName}}</view>
|
||||
<view class="author">{{item.authorName}} [著]</view>
|
||||
<view class="schedule">
|
||||
<view class="schedule-text">已读 {{item.precent}}</view>
|
||||
<view class="book-icon" v-if="!checkboOff">
|
||||
<i class="iconfont omit" @click.stop="omitBtn(index,item.bookShelfId)"></i>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<!-- 底下悬浮窗口 -->
|
||||
<view class="book-bottom" v-if="checkboOff">
|
||||
<view class="bottom-box">
|
||||
<view class="bottom-box-left">
|
||||
<view class="top-btn" v-if="checkboOff && !checkAllOff" @click="checkAll">
|
||||
<view>全选</view>
|
||||
</view>
|
||||
<view class="top-btn" v-if="checkboOff && checkAllOff" @click="checkNooAll">
|
||||
<view>全不选</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom-box-right">
|
||||
<view class="top-btn" @click="deleteBtn">
|
||||
<view>移出书架({{selection.length}})</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<z-navigation></z-navigation>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
bookNum: null, //
|
||||
topX: '', //x轴
|
||||
leftY: '', //y轴
|
||||
selection: [], //多选
|
||||
checkboOff: false, //显示多选开关
|
||||
checkAllOff: false, //全选全不选
|
||||
searchOff: false, //搜索
|
||||
moreOff: false, //更多弹窗开关
|
||||
moreId: '', //移除书籍ID
|
||||
bookData: [],
|
||||
bokMesDet:{}
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo'])
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getData();
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.getData()
|
||||
uni.stopPullDownRefresh()
|
||||
},
|
||||
//方法
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.bokMesDet.userId = this.userInfo.id
|
||||
|
||||
// 获取书架列表
|
||||
this.$http
|
||||
.post('book/bookshelf/getUserBookshelf', {
|
||||
'userId': this.userInfo.id
|
||||
})
|
||||
.then(res => {
|
||||
this.bookData = res.userBookshelf
|
||||
console.log(res)
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
bookCardBtn(e, value, id) { //卡片点击按钮
|
||||
//清空遗留数据
|
||||
this.bookNum = null
|
||||
this.topX = null
|
||||
this.leftY = null
|
||||
//开始脑残逻辑
|
||||
this.bookNum = value //第几个波纹效果显示
|
||||
this.topX = e.detail.x //获取相对于屏幕X轴坐标,并赋值
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('#' + id).boundingClientRect(data => {
|
||||
let cardT = JSON.stringify(data.top) //获取点击容器到顶距离
|
||||
let cardY = e.detail.y //获取相对于屏幕y轴坐标,并赋值
|
||||
this.leftY = Number(cardY) - Number(cardT) //计算容器内点击Y轴坐标
|
||||
}).exec();
|
||||
if (this.checkboOff == true) { //多选状态下的事件
|
||||
this.selection = []
|
||||
this.topX = e.detail.x - 44
|
||||
this.bookData[value].checked = !this.bookData[value].checked
|
||||
this.bookData.forEach(item => {
|
||||
if (item.checked === true) {
|
||||
this.selection.push(item.bookShelfId) //ID值,根据开发自定义 与上面checkbox的value绑定值相同
|
||||
}
|
||||
})
|
||||
if (this.selection.length == this.bookData.length) {
|
||||
this.checkAllOff = true
|
||||
} else if (this.selection.length < this.bookData.length) {
|
||||
this.checkAllOff = false
|
||||
}
|
||||
} else { //非多选状态下的事件
|
||||
const that = this;
|
||||
that.bokMesDet.id = that.bookData[value].bookShelfId
|
||||
that.bokMesDet.bookId = that.bookData[value].bookid
|
||||
|
||||
// 加入阅读记录
|
||||
$http.request({
|
||||
url: "book/bookshelf/update",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: that.bokMesDet,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(function(res) {
|
||||
if (res.code == 0) {
|
||||
// 跳转页面
|
||||
let chaId = 0
|
||||
if (that.bookData[value].chapterNum != null) {
|
||||
chaId = that.bookData[value].chapterNum-1
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '../yRead/angbook?Id=' + that.bookData[value].bookid + '&cha=' + chaId
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
//这里只会在接口是失败状态返回,不需要去处理错误提示
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
//去TM的安卓APP、苹果APP、微信小程序、微信网页、H5的全兼容,具体兼容那些版本我不测了。
|
||||
},
|
||||
managementBtn() { //管理按钮,打开多选和删除。
|
||||
this.selection = []
|
||||
this.checkboOff = true
|
||||
this.bookData.forEach(item => {
|
||||
this.$set(item, 'checked', false)
|
||||
})
|
||||
},
|
||||
checkAll() { //全选按钮
|
||||
//清空缓存
|
||||
this.selection = []
|
||||
//全选全不选显示切换
|
||||
this.checkAllOff = !this.checkAllOff
|
||||
//遍历数组
|
||||
this.bookData.forEach(item => {
|
||||
//新增属性
|
||||
this.$set(item, 'checked', true)
|
||||
this.selection.push(item.bookShelfId) //ID值,根据开发自定义 与上面checkbox的value绑定值相同
|
||||
|
||||
})
|
||||
console.log(this.selection)
|
||||
},
|
||||
checkNooAll() { //全不选按钮
|
||||
//清空缓存
|
||||
this.selection = []
|
||||
//全选全不选显示切换
|
||||
this.checkAllOff = !this.checkAllOff
|
||||
//遍历数组
|
||||
this.bookData.forEach(item => {
|
||||
this.$set(item, 'checked', false)
|
||||
})
|
||||
console.log(this.selection)
|
||||
},
|
||||
omitBtn(value, id) { //更多,打开针对单个的删除处理。
|
||||
console.log('你点了第' + value + '个更多,id为' + id)
|
||||
this.moreId = ''
|
||||
this.moreId = id
|
||||
this.moreOff = true
|
||||
},
|
||||
deleteBtn() { //移出书架按钮
|
||||
const that = this;
|
||||
if (that.selection.length > 0) {
|
||||
$http.request({
|
||||
url: "book/bookshelf/delete",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: that.selection,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(function(res) {
|
||||
console.log(res)
|
||||
if (res.code == 0) {
|
||||
that.getData();
|
||||
|
||||
uni.showToast({
|
||||
title: '移出书架成功!'
|
||||
})
|
||||
//移除书架后缓存清空复位
|
||||
that.selection = []
|
||||
that.checkboOff = false
|
||||
that.checkAllOff = false
|
||||
}
|
||||
}).catch(function(error) {
|
||||
//这里只会在接口是失败状态返回,不需要去处理错误提示
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
searchBtn() { //搜索按钮
|
||||
this.searchOff = true
|
||||
},
|
||||
cancelBtn() { //取消按钮
|
||||
// 清空复位
|
||||
this.searchOff = false
|
||||
this.selection = []
|
||||
this.checkboOff = false
|
||||
this.checkAllOff = false
|
||||
},
|
||||
accomplish() { //完成按钮
|
||||
// 清空复位
|
||||
this.searchOff = false
|
||||
this.selection = []
|
||||
this.checkboOff = false
|
||||
this.checkAllOff = false
|
||||
},
|
||||
examine() { //查看详情
|
||||
this.moreOff = false
|
||||
console.log('你查看了ID为' + this.moreId + '的书籍详情')
|
||||
},
|
||||
shiftOut() { //移出按钮
|
||||
this.moreOff = false
|
||||
console.log('你移出了ID为' + this.moreId + '的书籍')
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
$bookTop:46px;
|
||||
$bookCardHeight:200upx;
|
||||
$second: 0.6s;
|
||||
|
||||
.bookrack-body {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
/* #endif */
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: $navHeight;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.book-top {
|
||||
height: $bookTop;
|
||||
display: flex;
|
||||
// border-bottom: 1px solid $brimColor;
|
||||
padding: 0 20upx;
|
||||
// background-color: #fff;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
top: 150rpx;
|
||||
|
||||
.top-left {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
line-height: $bookTop;
|
||||
color: $dominantHue;
|
||||
max-width: 100upx;
|
||||
}
|
||||
|
||||
.top-right {
|
||||
flex: 1;
|
||||
line-height: $bookTop;
|
||||
text-align: right;
|
||||
color: $mediumGrey;
|
||||
}
|
||||
}
|
||||
|
||||
.book-rack::-webkit-scrollbar {
|
||||
display: none
|
||||
}
|
||||
|
||||
.book-rack {
|
||||
padding-top: $bookTop+20;
|
||||
|
||||
.uni-radio-group uni-label,
|
||||
uni-checkbox-group uni-label {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
.book-card {
|
||||
display: flex;
|
||||
|
||||
.book-checkbox {
|
||||
flex: 1;
|
||||
line-height: $bookCardHeight;
|
||||
padding: 10px 0 10px $bleed;
|
||||
min-width: 88upx;
|
||||
max-width: 88upx;
|
||||
box-sizing: border-box;
|
||||
animation: book-interaction 0.1s;
|
||||
}
|
||||
|
||||
@keyframes book-interaction {
|
||||
0% {
|
||||
min-width: 0upx;
|
||||
max-width: 0upx;
|
||||
}
|
||||
|
||||
100% {
|
||||
min-width: 88upx;
|
||||
max-width: 88upx;
|
||||
}
|
||||
}
|
||||
|
||||
.image-text {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
height: $bookCardHeight + 40upx;
|
||||
padding: 10px $bleed 10px $bleed;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
|
||||
|
||||
|
||||
.book-left {
|
||||
flex: 1;
|
||||
min-width: 170upx;
|
||||
max-width: 170upx;
|
||||
height: $bookCardHeight;
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
|
||||
.book-img {
|
||||
width: 150upx;
|
||||
height: $bookCardHeight;
|
||||
border-radius: 8upx;
|
||||
overflow: auto;
|
||||
background-color: $skeletonColor;
|
||||
}
|
||||
}
|
||||
|
||||
.book-right {
|
||||
position: relative;
|
||||
flex: 1;
|
||||
height: $bookCardHeight;
|
||||
z-index: 10;
|
||||
|
||||
.book-text {
|
||||
padding: 4upx 0;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.head {
|
||||
font-weight: bold;
|
||||
font-size: 30upx;
|
||||
height: 32upx;
|
||||
line-height: 32upx;
|
||||
color: $blackAll;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.author {
|
||||
padding-top: 24upx;
|
||||
font-size: 28upx;
|
||||
color: $mediumGrey;
|
||||
height: calc(100% - 8upx - 24upx - 28upx);
|
||||
}
|
||||
|
||||
.schedule {
|
||||
line-height: 28upx;
|
||||
height: 28upx;
|
||||
display: flex;
|
||||
|
||||
.schedule-text {
|
||||
flex: 1;
|
||||
font-size: 28upx;
|
||||
color: $mediumGrey;
|
||||
}
|
||||
|
||||
.book-icon {
|
||||
flex: 1;
|
||||
min-width: 55upx;
|
||||
max-width: 55upx;
|
||||
text-align: right;
|
||||
|
||||
.omit {
|
||||
font-size: 40upx;
|
||||
line-height: 28upx;
|
||||
color: $lightGray;
|
||||
padding: 10upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.top-btn {
|
||||
height: 48upx;
|
||||
line-height: 30upx;
|
||||
padding: 0upx 12upx;
|
||||
font-size: 28upx;
|
||||
display: inline-block;
|
||||
color: #54a966;
|
||||
font-weight: bold;
|
||||
margin-top: 14px;
|
||||
|
||||
.icon_search {
|
||||
background-image: url('@/static/icon/map_ic_search.png');
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
width: 35upx;
|
||||
height: 33upx;
|
||||
margin-right: 20upx;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.top-btn:active {
|
||||
background-color: $rippleBg;
|
||||
}
|
||||
|
||||
//波纹效果
|
||||
.ripple {
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
z-index: -5;
|
||||
background-color: $rippleBg;
|
||||
box-shadow: 0 0 0px 500px $rippleBg;
|
||||
border-radius: 50%;
|
||||
animation: myfirst $second;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
@keyframes myfirst {
|
||||
from {
|
||||
box-shadow: 0 0 0px 30px $rippleBg;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
box-shadow: 0 0 0px 500px $rippleBg;
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
// 底部悬浮
|
||||
.book-bottom {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 50rpx;
|
||||
right: 0;
|
||||
height: $navHeight + 30px;
|
||||
background-color: #fff;
|
||||
z-index: 110;
|
||||
border-top: 1px solid $brimColor;
|
||||
|
||||
.bottom-box {
|
||||
height: $navHeight+30px;
|
||||
padding: 0 15upx;
|
||||
line-height: $navHeight;
|
||||
color: $dominantHue;
|
||||
display: flex;
|
||||
|
||||
.bottom-box-left {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bottom-box-right {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//复选框 原生的处理起来有点难
|
||||
.checkboxcard {
|
||||
width: 38upx;
|
||||
height: 38upx;
|
||||
border-radius: 8upx;
|
||||
border: 1px solid #DCDFE6;
|
||||
margin-top: calc(100upx - 20upx)
|
||||
}
|
||||
|
||||
.checkboxactiva {
|
||||
border: 1px solid $dominantHue;
|
||||
box-shadow: 0 0 2px rgba(0, 134, 231, 0.5);
|
||||
}
|
||||
|
||||
.check {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.check::after {
|
||||
margin-top: -6upx;
|
||||
width: 6px;
|
||||
height: 12px;
|
||||
border-style: solid;
|
||||
border-color: $dominantHue;
|
||||
border-width: 0 2px 2px 0;
|
||||
-webkit-transform: rotateZ(45deg);
|
||||
content: " ";
|
||||
animation: check-interaction 0.1s;
|
||||
}
|
||||
|
||||
@keyframes check-interaction {
|
||||
0% {
|
||||
width: 0px;
|
||||
height: 0px;
|
||||
margin-top: -6upx;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
35% {
|
||||
width: 6px;
|
||||
height: 0px;
|
||||
|
||||
}
|
||||
|
||||
100% {
|
||||
height: 12px;
|
||||
margin-top: -6upx;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.input-cancel {
|
||||
display: flex;
|
||||
|
||||
.cancel-left {
|
||||
flex: 1;
|
||||
|
||||
.uni-input {
|
||||
line-height: 36px;
|
||||
height: 36px;
|
||||
font-size: 28upx;
|
||||
margin-top: calc((46px - 36px) / 2);
|
||||
background-color: #f4f4f4;
|
||||
border-radius: 8upx;
|
||||
padding: 0 20upx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-right {
|
||||
flex: 1;
|
||||
max-width: 85upx;
|
||||
min-width: 85upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.search-activa {
|
||||
z-index: 30;
|
||||
top: 20px;
|
||||
// bottom: 0px;
|
||||
animation: search-interaction 0.2s;
|
||||
}
|
||||
|
||||
.subject {
|
||||
transition: top 0.2s;
|
||||
}
|
||||
|
||||
@keyframes search-interaction {
|
||||
0% {
|
||||
top: $barHeight + 10px;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.more-shade {
|
||||
position: fixed;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.more {
|
||||
position: fixed;
|
||||
top: calc((100% - 300upx) / 2);
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
background-color: #fff;
|
||||
border-radius: 4upx;
|
||||
|
||||
.more-list {
|
||||
height: 100upx;
|
||||
line-height: 100upx;
|
||||
font-size: 30upx;
|
||||
padding: 0 40upx;
|
||||
color: $dominantHue;
|
||||
}
|
||||
|
||||
.more-underline {
|
||||
border-bottom: 1px solid #F1F1F1;
|
||||
}
|
||||
|
||||
.remove {
|
||||
color: $redAll;
|
||||
}
|
||||
}
|
||||
|
||||
.bookrack-active {
|
||||
bottom: $navHeight + 12px;
|
||||
}
|
||||
|
||||
/*苹果x适配 H5APP*/
|
||||
@media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
|
||||
.book-bottom {
|
||||
height: $navHeight + $navBoxHeight + 55px;
|
||||
}
|
||||
|
||||
.bookrack-body {
|
||||
top: 0;
|
||||
bottom: $navHeight + $navBoxHeight;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
bottom: $navHeight;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.bookrack-active {
|
||||
bottom: $navHeight + $navBoxHeight + 12px;
|
||||
}
|
||||
|
||||
|
||||
.search-activa {
|
||||
z-index: 30;
|
||||
top: $barHeight;
|
||||
animation: search-interaction 0.2s;
|
||||
}
|
||||
|
||||
@keyframes search-interaction {
|
||||
0% {
|
||||
top: $barHeight + $barTopHeight;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: $barHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*苹果xs适配 H5APP*/
|
||||
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) {
|
||||
.book-bottom {
|
||||
height: $navHeight + $navBoxHeight + 55px;
|
||||
}
|
||||
|
||||
.bookrack-body {
|
||||
top: 0;
|
||||
bottom: $navHeight + $navBoxHeight;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
bottom: $navHeight;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.bookrack-active {
|
||||
bottom: $navHeight + $navBoxHeight + 12px;
|
||||
}
|
||||
|
||||
|
||||
.search-activa {
|
||||
z-index: 30;
|
||||
top: $barHeight;
|
||||
animation: search-interaction 0.2s;
|
||||
}
|
||||
|
||||
@keyframes search-interaction {
|
||||
0% {
|
||||
top: $barHeight + $barTopHeight;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: $barHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*苹果xr适配 H5APP*/
|
||||
@media only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) {
|
||||
.book-bottom {
|
||||
height: $navHeight + $navBoxHeight + 30px;
|
||||
}
|
||||
|
||||
.bookrack-body {
|
||||
top: 0;
|
||||
bottom: $navHeight + $navBoxHeight;
|
||||
/* #ifdef H5 */
|
||||
top: 0;
|
||||
bottom: $navHeight;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.bookrack-active {
|
||||
bottom: $navHeight + $navBoxHeight + 30px;
|
||||
}
|
||||
|
||||
.search-activa {
|
||||
z-index: 30;
|
||||
top: $barHeight;
|
||||
animation: search-interaction 0.2s;
|
||||
}
|
||||
|
||||
@keyframes search-interaction {
|
||||
0% {
|
||||
top: $barHeight + $barTopHeight;
|
||||
}
|
||||
|
||||
100% {
|
||||
top: $barHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
275
pages/peanut/chargeDetaill.vue
Normal file
275
pages/peanut/chargeDetaill.vue
Normal file
@@ -0,0 +1,275 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<!-- <z-nav-bar title="我的订单"></z-nav-bar> -->
|
||||
<z-nav-bar title="充值详情"></z-nav-bar>
|
||||
|
||||
<view class="leve1">
|
||||
<view class="item flexbox" v-if="orderDetail.orderStatus == 3">
|
||||
<view class="">
|
||||
<view class="img">
|
||||
<image @click="" style="width: 120rpx; height: 120rpx; margin-top: 0;" class=""
|
||||
src="/static/icon/cgts.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
<text>充值成功</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<text style="font-size: 30rpx;">充值金额:</text><text style=" color: #ff5500;">¥</text>
|
||||
<text class="price">{{orderDetail.orderPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item flexbox" v-if="orderDetail.orderStatus == 0">
|
||||
<view class="">
|
||||
<view class="img">
|
||||
<image @click="" style="width: 120rpx; height: 120rpx; margin-top: 0;" class=""
|
||||
src="/static/icon/noPay.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
<text>待付款</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<text style="font-size: 30rpx;">充值金额:</text><text style=" color: #ff5500;">¥</text>
|
||||
<text class="price">{{orderDetail.orderPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item flexbox" v-if="orderDetail.orderStatus > 3">
|
||||
<view class="">
|
||||
<view class="img">
|
||||
<image @click="" style="width: 120rpx; height: 120rpx; margin-top: 0;" class=""
|
||||
src="/static/icon/fail.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="txt">
|
||||
<text>充值失败</text>
|
||||
</view>
|
||||
<view class="">
|
||||
<text style="font-size: 30rpx;">充值金额:</text><text style=" color: #ff5500;">¥</text>
|
||||
<text class="price">{{orderDetail.orderPrice}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="leve2">
|
||||
<view class="times">
|
||||
<view class="flexbox">
|
||||
<text>订单编号:</text><text>{{orderDetail.orderSn}}</text>
|
||||
</view>
|
||||
<view class="flexbox">
|
||||
<text>订单创建时间:</text><text>{{orderDetail.createTime}}</text>
|
||||
</view>
|
||||
<view class="flexbox" v-if="orderDetail.orderStatus > 0">
|
||||
<text>到账时间:</text><text>{{orderDetail.createTime}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="leve3 flexbox">
|
||||
<view class="item">
|
||||
<button v-if="orderDetail.orderStatus == 3" @click="goHome" class="mini-btn" type="primary" style="backgroundColor:#1AAD19;borderColor:#1AAD19" >完成</button>
|
||||
<button v-if="orderDetail.orderStatus == 0" @click="goPay" class="mini-btn" type="warn" >去支付</button>
|
||||
</view>
|
||||
<view class="item" v-if="orderDetail.orderStatus == 3">
|
||||
<button class="mini-btn" type="primary" @click="goCharge">继续充值</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<z-navigation></z-navigation>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
setPay,
|
||||
setPayAssign,
|
||||
setWXPay
|
||||
} from '@/config/utils';
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData: {},
|
||||
orderId: null,
|
||||
orderSn: '',
|
||||
orderDetail: {},
|
||||
titleStat: '',
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderId = e.orderId
|
||||
this.orderSn = e.orderSn
|
||||
},
|
||||
onShow() {
|
||||
this.getOrderDetail()
|
||||
},
|
||||
components: {
|
||||
musicPlay
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
// 支付
|
||||
goPay() {
|
||||
let payItem = this.orderDetail
|
||||
console.log(payItem, 'payItem')
|
||||
if (payItem.paymentMethod == 2) {
|
||||
console.log('阿里支付')
|
||||
setPay({
|
||||
typePay: 'alipay',
|
||||
subject: 'order',
|
||||
totalAmount: payItem.realMoney,
|
||||
type: 2,
|
||||
relevanceoid: payItem.orderSn,
|
||||
customerId: this.userInfo.id,
|
||||
}, res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/persCount'
|
||||
})
|
||||
},2000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
this.getOrderDetail()
|
||||
})
|
||||
} else if (payItem.paymentMethod == 1) {
|
||||
console.log('微信支付')
|
||||
// console.log(this.isAndorid)
|
||||
if (this.isAndorid == false) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '很抱歉,苹果系统暂不支持微信支付',
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
} else {
|
||||
let data1 = {
|
||||
orderSn: payItem.orderSn,
|
||||
buyOrderId: null,
|
||||
totalAmount: payItem.realMoney
|
||||
}
|
||||
console.log(data1, 'data1')
|
||||
setWXPay(data1, res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/persCount'
|
||||
})
|
||||
},2000)
|
||||
} else {
|
||||
console.log(res)
|
||||
if (res.data.errMsg.indexOf('User canceled') != -1) {
|
||||
uni.showToast({
|
||||
title: "用户取消支付",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} else if (payItem.paymentMethod == 3) {
|
||||
// 苹果充值
|
||||
console.log('苹果二次支付')
|
||||
if (this.isAndorid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
showCancel: false,
|
||||
content: '很抱歉,当前订单属于苹果系统内购订单,安卓系统无法完成支付操作,您可切换到苹果系统进行支付,也可以取消该订单,并重新下单'
|
||||
})
|
||||
} else {
|
||||
// this.iphonepay(payItem)
|
||||
}
|
||||
}
|
||||
},
|
||||
goCharge(){
|
||||
uni.navigateTo({
|
||||
url:'./reCharge'
|
||||
})
|
||||
},
|
||||
goHome(){
|
||||
uni.switchTab({
|
||||
url:'/pages/peanut/home'
|
||||
})
|
||||
},
|
||||
getOrderDetail() {
|
||||
this.$http
|
||||
.get(`/book/buyOrder/orderDetail?orderSn=${this.orderSn}`)
|
||||
.then(res => {
|
||||
console.log('订单详情', res)
|
||||
this.orderDetail = res.result
|
||||
this.consigneeShow = true
|
||||
// console.log(this.orderContet,'this.orderContet')
|
||||
if (this.orderDetail.orderStatus == 0) {
|
||||
this.titleStat = '待支付'
|
||||
} else if (this.orderDetail.orderStatus == 1) {
|
||||
this.titleStat = '待发货'
|
||||
} else if (this.orderDetail.orderStatus == 2) {
|
||||
this.titleStat = '待收货'
|
||||
} else if (this.orderDetail.orderStatus == 3) {
|
||||
this.titleStat = '已完成'
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.flexbox{display: flex;}
|
||||
.container {
|
||||
height: 100vh;
|
||||
background-color: #fff;
|
||||
padding: 10rpx;
|
||||
}
|
||||
|
||||
.leve1 {
|
||||
.item {
|
||||
text-align: center;
|
||||
height: 400rpx;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.txt{margin-bottom: 20rpx;}
|
||||
.price{font-size: 50rpx; color: #ff5500; }
|
||||
.img { margin-bottom: 20rpx;
|
||||
image {
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.leve2{ text-align: center; font-size: 30rpx;
|
||||
|
||||
.times{ padding: 20rpx; font-size: 28rpx; line-height: 60rpx;
|
||||
.flexbox{width: 100%; justify-content:space-between;}
|
||||
}
|
||||
}
|
||||
.leve3{width: 100%; justify-content: space-around; margin-top: 50rpx;
|
||||
.item{width: 40%;}
|
||||
}
|
||||
</style>
|
||||
1571
pages/peanut/home.vue
Normal file
1571
pages/peanut/home.vue
Normal file
File diff suppressed because it is too large
Load Diff
467
pages/peanut/mine.vue
Normal file
467
pages/peanut/mine.vue
Normal file
@@ -0,0 +1,467 @@
|
||||
<template>
|
||||
<view style="padding: 0 40rpx; font-size: 28upx">
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<view style="height: 50rpx"></view>
|
||||
<view class="per_mes">
|
||||
<image
|
||||
:src="userMes.avatar"
|
||||
v-if="userMes.avatar != null"
|
||||
class="per_mes_img"
|
||||
></image>
|
||||
<image
|
||||
src="../../static/icon/home_icon_1.png"
|
||||
v-if="userMes.avatar == null"
|
||||
class="per_mes_img"
|
||||
></image>
|
||||
<view>
|
||||
<text class="name" v-if="userMes.nickname != null">{{
|
||||
userMes.nickname
|
||||
}}</text>
|
||||
<text class="name" v-if="userMes.nickname == null">未设置</text>
|
||||
<!-- <image v-if="userMes.vip==1" src="../../static/icon/mine_v.png" alt="" class="per_user_img"></image> -->
|
||||
<text
|
||||
style="margin-left: 20rpx; font-size: 22rpx; color: #888"
|
||||
v-if="userMes.tel"
|
||||
>({{ userMes.tel }})</text
|
||||
>
|
||||
<text style="margin-left: 20rpx; font-size: 22rpx; color: #888" v-else
|
||||
>({{ userMes.email }})</text
|
||||
>
|
||||
|
||||
<!-- <text class="tong">累计读书5本
|
||||
<span style="margin: 0 20upx;">|</span> 今日读50分钟
|
||||
</text> -->
|
||||
</view>
|
||||
<br clear="both" />
|
||||
</view>
|
||||
<!-- <view class="now_vip" v-if="userMes.vip==0">
|
||||
<text>
|
||||
<image src="../../static/icon/mine_p.png" style="height: 44rpx;"></image>
|
||||
开通会员畅享海量内容
|
||||
</text>
|
||||
<b class="kt_btn" @click="onPageJump('./opeVip')">开通VIP</b>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="now_vip" v-if="userMes.vip==1">
|
||||
<text>
|
||||
<image src="../../static/icon/mine_v.png"></image>
|
||||
尊贵的VIP会员
|
||||
<font style="font-size: 14rpx;margin-left: 20rpx;">{{userMes.vipValidtime}}到期</font>
|
||||
</text>
|
||||
<b class="kt_btn" @click="onPageJump('./opeVip')">立即续费</b>
|
||||
</view> -->
|
||||
|
||||
<view class="chong_zhi">
|
||||
<view class="zhanghu" @click="onPageJump('../user/persCount')">
|
||||
我的账户
|
||||
<text style="float: right; line-height: 85rpx"> > </text>
|
||||
</view>
|
||||
<view class="chong_list">
|
||||
<view v-if="iosHide">
|
||||
<b>{{ userMes.peanutCoin }}</b>
|
||||
天医币
|
||||
</view>
|
||||
<view v-if="iosHide">
|
||||
<b>{{ userMes.conponsCount }}</b>
|
||||
优惠券
|
||||
</view>
|
||||
<!-- <b class="chong_btn" @click="onPageJump('../sdkDemo/pay')">充 值</b> -->
|
||||
<b class="chong_btn" v-if="iosHide" @click="onPageJump('./reCharge')"
|
||||
>充 值</b
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="xiugai">
|
||||
<view class="nav_list" @click="onPageJump('../bookShop/orderList')">
|
||||
<text>我的订单</text>
|
||||
</view>
|
||||
<!-- <view class="nav_list" @click="onPageJump('../clock/clockList')">
|
||||
<text>我的打卡</text>
|
||||
</view> -->
|
||||
<!-- <view class="nav_list" @click="onPageJump('../listen/home')" v-if="iosHide">
|
||||
<text>我的听书</text>
|
||||
</view> -->
|
||||
<!-- 暂时去掉 -->
|
||||
<!-- <view class="nav_list" @click="onPageJump('../listen/setListen')" v-if="iosHide">
|
||||
<text>听书设置</text>
|
||||
</view> -->
|
||||
<!-- <view class="nav_list" @click="onPageJump('../peanut/myComments')">
|
||||
<text>我的评价</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 暂时去掉 -->
|
||||
<view class="nav_list" @click="onPageJump('../peanut/shopping')">
|
||||
<text>购物车</text>
|
||||
</view>
|
||||
<!-- <view v-if="showEbook" class="nav_list" @click="onPageJump('../eBook/bookBuy')">
|
||||
<text>电子书购买记录</text>
|
||||
</view> -->
|
||||
<!-- <view v-if="showEbook" class="nav_list" @click="onPageJump('../eBook/bookRecord')">
|
||||
<text>阅读记录</text>
|
||||
</view> -->
|
||||
<view class="nav_list" @click="onPageJump('../user/persData')">
|
||||
<text>修改个人资料</text>
|
||||
</view>
|
||||
<view class="nav_list" @click="onPageJump('../user/address')">
|
||||
<text>地址管理</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="nav_list" @click="onGoing()">
|
||||
<text>帮助与反馈11111</text>
|
||||
</view> -->
|
||||
<!-- <view class="nav_list" @click="newOnShare" v-if="isAndorid"> -->
|
||||
<view class="nav_list" @click="newOnShare">
|
||||
<text>分享App</text>
|
||||
</view>
|
||||
<view class="nav_list" @click="onPageJump('../peanut/aboutUs')">
|
||||
<text>关于我们</text>
|
||||
</view>
|
||||
<view class="nav_list" @click="signShow = true">
|
||||
<text>退出登录</text>
|
||||
</view>
|
||||
<view class="nav_list" @click="logout">
|
||||
<text>注销帐号</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-modal
|
||||
:show="signShow"
|
||||
:content="signContent"
|
||||
:showCancelButton="true"
|
||||
@cancel="signShow = false"
|
||||
@confirm="signOut"
|
||||
>
|
||||
</u-modal>
|
||||
<!-- 分享弹窗 -->
|
||||
<uni-popup ref="share" type="share" safeArea backgroundColor="#fff">
|
||||
<uni-popup-share @select="haveSelected"></uni-popup-share>
|
||||
</uni-popup>
|
||||
|
||||
<music-play :playData="playData"></music-play>
|
||||
<z-navigation></z-navigation>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from "@/components/music.vue";
|
||||
import $http from "@/config/requestConfig.js";
|
||||
// import appShare, { closeShare } from '@/uni_modules/zhouWei-APPshare/js_sdk/appShare';
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showEbook: false, // 显示电子书相关
|
||||
userMes: {},
|
||||
signShow: false,
|
||||
signContent: "是否要退出登录?",
|
||||
playData: {},
|
||||
isAndorid: true,
|
||||
platform: null, // 设备系统
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
// #ifdef APP-PLUS
|
||||
this.getOS();
|
||||
this.platform = uni.getSystemInfoSync().platform;
|
||||
// console.log('操纵系统',this.platform)
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
...mapState(["userInfo"]),
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getData();
|
||||
},
|
||||
components: {
|
||||
musicPlay,
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
...mapMutations(["setUserInfo"]),
|
||||
// 获得操作系统
|
||||
getOS() {
|
||||
let oprateOs = "";
|
||||
oprateOs = uni.getSystemInfoSync().platform;
|
||||
// console.log(oprateOs)
|
||||
if (oprateOs == "android") {
|
||||
this.isAndorid = true;
|
||||
} else {
|
||||
this.isAndorid = false;
|
||||
}
|
||||
},
|
||||
haveSelected(data) {
|
||||
console.log(data, " 选择的是");
|
||||
if (data.index == 0) {
|
||||
// 分享到好友
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: "WXSceneSession",
|
||||
type: 0,
|
||||
href: this.$apkUrl,
|
||||
title: "疯子读书",
|
||||
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
|
||||
imageUrl: "static/fengziIcon.jpg",
|
||||
success: function (res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log("fail:" + JSON.stringify(err));
|
||||
},
|
||||
});
|
||||
} else if (data.index == 1) {
|
||||
// 分享到朋友圈
|
||||
uni.share({
|
||||
provider: "weixin",
|
||||
scene: "WXSceneTimeline",
|
||||
type: 0,
|
||||
href: this.$apkUrl,
|
||||
title: "疯子读书",
|
||||
summary: "我正在使用疯子读书提升自己,赶紧跟我一起来体验吧!",
|
||||
imageUrl: "static/fengziIcon.jpg",
|
||||
success: function (res) {
|
||||
console.log("success:" + JSON.stringify(res));
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log("fail:" + JSON.stringify(err));
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
switchTab(url) {
|
||||
uni.switchTab({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
getData() {
|
||||
// 获取个人信息
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http.post("book/user/info/" + this.userInfo.id).then((res) => {
|
||||
this.userMes = res.user;
|
||||
if (this.userMes.vip == 1) {
|
||||
this.userMes.vipValidtime = this.userMes.vipValidtime.substring(
|
||||
0,
|
||||
this.userMes.vipValidtime.indexOf(" ")
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 新写分享
|
||||
newOnShare() {
|
||||
this.$refs.share.open();
|
||||
},
|
||||
|
||||
// 注销账户
|
||||
logout() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确定要注销当前账户吗?",
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
showCancel: false,
|
||||
content: `注销申请已提交成功,请联系客服进行后续操作:022-24142321`,
|
||||
success: function (res1) {
|
||||
if (res1.confirm) {
|
||||
that.signOut();
|
||||
}
|
||||
},
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
// 取消操作
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 跳转
|
||||
onGoing() {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "开发中,敬请期待...",
|
||||
});
|
||||
},
|
||||
onPageJump(url) {
|
||||
console.log(url, "url");
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
signOut() {
|
||||
this.signShow = false;
|
||||
this.setUserInfo({ token: null });
|
||||
uni.reLaunch({
|
||||
url: "../user/login",
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "@/style/mixin.scss";
|
||||
|
||||
.per_mes {
|
||||
margin: 50rpx 0 50rpx 0;
|
||||
align-items: center;
|
||||
|
||||
.per_mes_img {
|
||||
width: 120upx;
|
||||
height: 120upx;
|
||||
background-color: #fff;
|
||||
border-radius: 120upx;
|
||||
margin: 0 30upx 0 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
view {
|
||||
float: left;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.name {
|
||||
display: inline-block;
|
||||
font-weight: bold;
|
||||
font-size: 38upx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.tong {
|
||||
color: #999;
|
||||
font-size: 25upx;
|
||||
}
|
||||
|
||||
.per_user_img {
|
||||
display: inline-block;
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
margin-left: 10rpx;
|
||||
vertical-align: super;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.now_vip {
|
||||
background-color: #fff;
|
||||
// border-radius: 20upx;
|
||||
margin: 0 0 30upx 0;
|
||||
padding: 0 30upx;
|
||||
height: 120upx;
|
||||
background-image: linear-gradient(90deg, #feeed6 0%, #f5ce99 100%);
|
||||
|
||||
image {
|
||||
width: 46rpx;
|
||||
height: 50rpx;
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
margin: 0 10rpx 0 0;
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 30upx;
|
||||
line-height: 120upx;
|
||||
color: #977749;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.kt_btn {
|
||||
font-size: 26upx;
|
||||
display: block;
|
||||
float: right;
|
||||
border-radius: 50rpx;
|
||||
color: #fffbf6;
|
||||
padding: 12rpx 26rpx;
|
||||
margin: 33rpx 0 0 0;
|
||||
background-image: linear-gradient(90deg, #dfa964 0%, #7f5218 100%);
|
||||
}
|
||||
}
|
||||
|
||||
.chong_zhi {
|
||||
background-color: #fff;
|
||||
margin: 0 0 30upx 0;
|
||||
padding: 0 30upx;
|
||||
height: 240upx;
|
||||
|
||||
.zhanghu {
|
||||
font-size: 32upx;
|
||||
line-height: 100upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.chong_list {
|
||||
view {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
display: inline-block;
|
||||
color: #a3a1a1;
|
||||
|
||||
b {
|
||||
font-size: 45rpx;
|
||||
display: block;
|
||||
margin: 0 0 10rpx 0;
|
||||
color: #76757b;
|
||||
}
|
||||
}
|
||||
|
||||
.chong_btn {
|
||||
font-size: 26upx;
|
||||
display: block;
|
||||
float: right;
|
||||
border-radius: 50rpx;
|
||||
color: #fffbf6;
|
||||
padding: 12rpx 42rpx;
|
||||
margin: 20rpx 0 0 0;
|
||||
background: #815219;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.xiugai {
|
||||
.nav_list {
|
||||
background-color: #fff;
|
||||
padding: 30upx 0 30upx 20upx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
font-weight: bold;
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
|
||||
&:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
text {
|
||||
color: #333;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
right: 20upx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
background-image: url("../../static/icon/icon_right.png");
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.nav_list:nth-last-child(1) {
|
||||
border-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
731
pages/peanut/opeVip.vue
Normal file
731
pages/peanut/opeVip.vue
Normal file
@@ -0,0 +1,731 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="会员中心" type="transparent" fontColor="#FFF"></z-nav-bar>
|
||||
<view class="vip_top">
|
||||
<view class="now_vip">
|
||||
<image src="../../static/icon/mine_card.png" alt=""></image>
|
||||
<view class="text">
|
||||
<image src="../../static/icon/mine_v.png" alt=""></image>
|
||||
疯子读书会员
|
||||
<br>
|
||||
<i>VIPFENGZIDUSHU</i>
|
||||
<br>
|
||||
<b>加入会员立项4项特权</b>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip_quan">
|
||||
<view class="vq_title">会员特权</view>
|
||||
<view class="vq_bord">
|
||||
<view class="vq_b_list">
|
||||
<view>
|
||||
<image src="../../static/icon/mine_ic1.png" alt=""></image>
|
||||
</view>
|
||||
<text>免费阅读</text>
|
||||
</view>
|
||||
<view class="vq_b_list">
|
||||
<view>
|
||||
<image src="../../static/icon/mine_ic2.png" alt=""></image>
|
||||
</view>
|
||||
<text>优惠券</text>
|
||||
</view>
|
||||
<view class="vq_b_list">
|
||||
<view>
|
||||
<image src="../../static/icon/mine_ic3.png" alt=""></image>
|
||||
</view>
|
||||
<text>购书折扣</text>
|
||||
</view>
|
||||
<view class="vq_b_list">
|
||||
<view>
|
||||
<image src="../../static/icon/mine_ic4.png" alt=""></image>
|
||||
</view>
|
||||
<text>24h客服</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip_chong">
|
||||
<view class="vc_title">服务类型</view>
|
||||
<view class="vc_xiang">
|
||||
<view v-for="(item, index) in vcList" @click="chosPric(item)"
|
||||
:class="stepsVc.priceTypeId == item.priceTypeId?'Tab_vc vc_price':'vc_price'">
|
||||
<view class="pr_tm">{{item.description}}</view>
|
||||
<view class="pr_jg">¥{{item.realMoney}}</view>
|
||||
<view class="pr_yl">¥{{item.money}}</view>
|
||||
<view class="pr_lj">限时特惠</view>
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
</view>
|
||||
<view class="vip_fangsh">
|
||||
<view class="vf_title">支付方式</view>
|
||||
<view class="vf_radio">
|
||||
<u-radio-group v-model="payType">
|
||||
<view style="width: 100%;">
|
||||
<view v-for="(item, index) in paylist" @click="choseType(item.id)" class="vf_xuanx">
|
||||
<image :src="item.img"></image>
|
||||
{{item.title}}
|
||||
<span v-if="item.id == 4" style="color: #bbb; margin-left: 10px;">{{userMes.peanutCoin}}天医币可用</span>
|
||||
<span @click.stop="buPoint" style="color: #bf0c0c; margin-left: 10px;" v-if="item.id == 4" class="chongBtn">去充值</span>
|
||||
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
style="float: right;margin-top: 5rpx;"></u-radio>
|
||||
</view>
|
||||
</view>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="agree_wo" style="float: left; display: flex;">
|
||||
<radio-group class="agree">
|
||||
<view v-for="(item, index) in argee" :key="index" >
|
||||
<radio class="agreeRadio" :value="item.id" :checked="item.id==radioValue" @click="radioCheck(index)"></radio>
|
||||
<!-- <view>{{item.value}}</view> -->
|
||||
</view>
|
||||
</radio-group>
|
||||
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《会员服务协议》</span></view></view>
|
||||
|
||||
<view class="vip_btn">
|
||||
<view @click="goPoinBuy">立即开通会员</view>
|
||||
</view>
|
||||
<!-- 充值协议 -->
|
||||
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow=false">
|
||||
<view class="tanchu">
|
||||
<view class="dp_title">{{xieyi.title}}</view>
|
||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||
<view v-html="xieyi.content"></view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
import {
|
||||
setPay,
|
||||
setPayAssign
|
||||
} from '@/config/utils';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
xieyiShow : false,
|
||||
xieyi:{
|
||||
title:'',
|
||||
content:''
|
||||
},
|
||||
argee:[
|
||||
{value:false,id:'1'}
|
||||
|
||||
] ,// 同意权限
|
||||
radioValue:'',
|
||||
stepsVc: {},
|
||||
vcList: [],
|
||||
userMes:{},
|
||||
payType: 4,
|
||||
paylist: [
|
||||
// {
|
||||
// title: '支付宝',
|
||||
// id: 1,
|
||||
// img: '../../static/icon/pay_1.png'
|
||||
// },
|
||||
{
|
||||
title: '天医币充值',
|
||||
id: 4,
|
||||
img: '../../static/icon/oder_chong.png'
|
||||
}
|
||||
// {
|
||||
// title: '微信',
|
||||
// id: 2,
|
||||
// img: '../../static/icon/pay_2.png'
|
||||
// }
|
||||
],
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getData()
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
this.getDataPoint()
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
showXieyi(){
|
||||
this.$http
|
||||
.get(`sys/agreement/list?key=member`)
|
||||
.then(res => {
|
||||
this.xieyi = res.page.list[0]
|
||||
this.xieyiShow = true
|
||||
})
|
||||
|
||||
},
|
||||
radioCheck (index) {
|
||||
this.argee.forEach((item =>{
|
||||
item.isCheck = false
|
||||
}))
|
||||
if(this.radioValue==this.argee[index].id) {
|
||||
this.radioValue =null
|
||||
}else {
|
||||
this.radioValue = this.argee[index].id
|
||||
}
|
||||
// console.log(this.radioValue)
|
||||
},
|
||||
goPoinBuy(){
|
||||
if(this.radioValue == '1'){
|
||||
|
||||
if(this.stepsVc.money > this.userMes.peanutCoin){
|
||||
// uni.showToast({
|
||||
// title:'天医币不足,请充值',
|
||||
// icon: 'none',
|
||||
// duration: 2000
|
||||
// })
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '天医币不足',
|
||||
confirmText:'去充值',
|
||||
showCancel:'知道了',
|
||||
success: function (res) {
|
||||
let that = this
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
uni.navigateTo({
|
||||
url: '../peanut/reCharge'
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
//console.log('用户点击取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
}else{
|
||||
this.kaiVip()
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'请勾选服务协议',
|
||||
icon:'error'
|
||||
})
|
||||
return false
|
||||
}
|
||||
},
|
||||
// 充值天医币
|
||||
buPoint() {
|
||||
uni.navigateTo({
|
||||
url: '../peanut/reCharge'
|
||||
});
|
||||
},
|
||||
getDataPoint() {
|
||||
let that = this
|
||||
// 获取个人信息
|
||||
// 用户详情
|
||||
if (this.userInfo.id != undefined) {
|
||||
this.$http
|
||||
.post('book/user/info/' + this.userInfo.id)
|
||||
.then(res => {
|
||||
this.userMes = res.user
|
||||
// consol.log(this.userMes.peanutCoin,'呼呼')
|
||||
if (this.userMes.vip != 0) {
|
||||
this.typeFen = 2
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取会员类型
|
||||
getData() {
|
||||
let that = this
|
||||
this.$http
|
||||
.post('book/bookbuyconfig/getVipOrPoint', {
|
||||
type: 'vip',
|
||||
qudao: 'Android'
|
||||
})
|
||||
.then(res => {
|
||||
that.vcList = res.list
|
||||
that.stepsVc = res.list[0]
|
||||
});
|
||||
},
|
||||
|
||||
// 点击会员价格
|
||||
chosPric(e) {
|
||||
let that = this
|
||||
that.stepsVc = e
|
||||
},
|
||||
|
||||
// 选择支付方式
|
||||
choseType(e) {
|
||||
let that = this
|
||||
that.payType = e
|
||||
},
|
||||
|
||||
// 开通vip 常规支付
|
||||
kaiVip() {
|
||||
let that = this
|
||||
|
||||
let data = {
|
||||
userId: that.userInfo.id, //下单人ID
|
||||
userPhone: that.userInfo.tel, //收货人手机号
|
||||
paymentMethod: that.payType, //1支付宝,2微信,3ios内购
|
||||
orderMoney: that.stepsVc.money * 1, //订单金额
|
||||
districtMoney: 0, //优惠金额
|
||||
realMoney: that.stepsVc.money * 1, //实收金额
|
||||
orderStatus: 0, //订单状态
|
||||
orderType: "vip", //订单类型
|
||||
}
|
||||
$http.request({
|
||||
url: "book/buyOrder/rechargeSave",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
console.log(res)
|
||||
if(that.payType != 4){
|
||||
setPay({
|
||||
typePay: 'alipay',
|
||||
subject: 'vip',
|
||||
totalAmount: that.stepsVc.money,
|
||||
type: that.payType,
|
||||
relevanceoid: res.orderSn,
|
||||
body: that.stepsVc.priceTypeId,
|
||||
}, res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
})
|
||||
}else{
|
||||
console.log(that.userMes)
|
||||
this.$http
|
||||
.post('book/user/openVipByVirtualCoin', {
|
||||
'configId': that.stepsVc.priceTypeId,
|
||||
'userId': that.userMes.id,
|
||||
'orderSn':res.orderSn
|
||||
})
|
||||
.then(res => {
|
||||
if(res.code == 0){
|
||||
console.log(res, 'res')
|
||||
uni.showToast({
|
||||
title: "充值成功",
|
||||
icon:'success',
|
||||
duration:2000
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.switchTab({
|
||||
url: '../bookShop/orderList'
|
||||
});
|
||||
},1000)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "下单失败",
|
||||
icon:'Error',
|
||||
duration:2000
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
.highlight{color: $uni-color-primary;}
|
||||
.agreeRadio{ zoom: .8;}
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
|
||||
|
||||
.dp_title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 50rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_add {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
right: 30rpx;
|
||||
font-size: 22rpx;
|
||||
background-color: #fd6004;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
|
||||
.u-icon {
|
||||
display: inline-block;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.addressItem {
|
||||
border: 2px dashed #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
|
||||
.addrContent {
|
||||
margin-left: 40rpx;
|
||||
flex: 1;
|
||||
|
||||
.addrContentTop {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
margin: 0 0 15rpx 0;
|
||||
position: relative;
|
||||
|
||||
.userName {
|
||||
font-size: 35rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.userTel {
|
||||
font-size: 25rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.userMoren {
|
||||
border: 1px solid #fd6004;
|
||||
color: #fd6004;
|
||||
padding: 3rpx 10rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.chooseCheck {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
right: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.addrContentBottom {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.addressItem.addItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
|
||||
.youhuiItem {
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.youhuiItem>view {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.youhuiItem.youItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
}
|
||||
.chongBtn {
|
||||
background-color: #54a966;
|
||||
color: #fff !important;
|
||||
margin-left: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 2rpx 10rpx;
|
||||
font-size: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
.vip_top {
|
||||
// background-color: #2c271d;
|
||||
background-image: url('../../static/icon/mine_back.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 160rpx 40rpx 20rpx 40rpx;
|
||||
height: 450rpx;
|
||||
position: relative;
|
||||
|
||||
.now_vip {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 340rpx;
|
||||
margin: 0 0 30upx 0;
|
||||
padding: 0 40upx 0 40upx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 410rpx;
|
||||
}
|
||||
.text{margin-top: 60rpx;
|
||||
font-size: 50upx;
|
||||
line-height: 80upx;
|
||||
color: #977749;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
left: 80rpx;
|
||||
top: 3rpx;}
|
||||
.text {
|
||||
margin-top: 60rpx;
|
||||
font-size: 50upx;
|
||||
line-height: 80upx;
|
||||
color: #977749;
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
left: 80rpx;
|
||||
top: 3rpx;
|
||||
|
||||
image {
|
||||
width: 80rpx;
|
||||
height: 90rpx;
|
||||
display: inline-block;
|
||||
vertical-align: text-bottom;
|
||||
margin: 0 10rpx 0 0;
|
||||
|
||||
}
|
||||
|
||||
i {
|
||||
font-size: 40upx;
|
||||
margin-left: 80rpx;
|
||||
}
|
||||
|
||||
b {
|
||||
font-size: 25upx;
|
||||
margin: 40rpx 0 0 20rpx;
|
||||
display: block;
|
||||
color: #c39a5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.vip_quan {
|
||||
margin: 120rpx 50rpx 0 50rpx;
|
||||
|
||||
.vq_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.vq_bord {
|
||||
margin: 40rpx 0 0 0;
|
||||
overflow: hidden;
|
||||
|
||||
.vq_b_list {
|
||||
float: left;
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
|
||||
|
||||
view {
|
||||
padding: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
background-image: url('../../static/icon/mine_bor.png');
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 55%;
|
||||
margin: 0 auto;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 50rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 30rpx;
|
||||
margin: 20rpx 0 0 0;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
view:nth-child(4n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.vip_chong {
|
||||
margin: 50rpx 50rpx 0 50rpx;
|
||||
|
||||
.vc_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
.vc_xiang {
|
||||
margin-top: 50rpx;
|
||||
|
||||
.vc_price {
|
||||
box-shadow: 0 0 20rpx 0 #0000001a;
|
||||
float: left;
|
||||
width: 47%;
|
||||
margin: 0 30rpx 30rpx 0;
|
||||
text-align: center;
|
||||
padding: 50rpx 0 20rpx 0;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
color: #2d2d2d;
|
||||
|
||||
.pr_tm {
|
||||
font-size: 38rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pr_jg {
|
||||
font-size: 45rpx;
|
||||
margin: 20rpx 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pr_yl {
|
||||
font-size: 25rpx;
|
||||
margin-left: 10rpx;
|
||||
text-decoration: line-through;
|
||||
color: #d9d9d9;
|
||||
position: absolute;
|
||||
bottom: 50rpx;
|
||||
right: 15rpx;
|
||||
}
|
||||
|
||||
.pr_lj {
|
||||
background-color: #fe6e09;
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
left: 0;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.vc_price:nth-child(2n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.Tab_vc {
|
||||
box-shadow: 0 0 20rpx 0 #fe700bcc;
|
||||
color: #7b4c0a;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
.vip_fangsh {
|
||||
margin: 40rpx 50rpx 0 50rpx;
|
||||
|
||||
.vf_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.vf_radio {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.vf_xuanx {
|
||||
font-size: 32rpx;
|
||||
padding-bottom: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.agree_wo {
|
||||
color: #aaa;
|
||||
font-size: 25rpx;
|
||||
margin-top: 30rpx;
|
||||
margin: 40rpx 50rpx 0 50rpx;
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
.vip_btn {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 30rpx;
|
||||
|
||||
view {
|
||||
background-image: linear-gradient(90deg, #feeed5 0%, #f5cd98 100%);
|
||||
color: #865b25;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
font-size: 35rpx;
|
||||
font-weight: bold;
|
||||
padding: 25rpx 0;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
756
pages/peanut/reCharge.vue
Normal file
756
pages/peanut/reCharge.vue
Normal file
@@ -0,0 +1,756 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
<z-nav-bar title="充值"></z-nav-bar>
|
||||
<view class="cha_jine">
|
||||
<view class="cj_title">充值金额</view>
|
||||
<view class="cj_xiang">
|
||||
<view v-for="(item, index) in cjList" @click="chosPric(item)"
|
||||
:class="stepsCj.priceTypeId == item.priceTypeId?'Tab_cj cj_price':'cj_price'">
|
||||
<view class="pr_jg">¥{{item.realMoney}}</view>
|
||||
<view class="pr_yl">{{item.money}} 天医币</view>
|
||||
<view class="pr_lj">限时特惠</view>
|
||||
</view>
|
||||
<br clear="both">
|
||||
</view>
|
||||
</view>
|
||||
<view class="cha_fangsh">
|
||||
<view class="cf_title">支付方式</view>
|
||||
|
||||
<view class="cf_radio">
|
||||
<u-radio-group v-model="payType">
|
||||
|
||||
<view style="width: 100%;" v-if="isAndroid">
|
||||
<view v-for="(item, index) in paylist" @click="choseType(item.id)"
|
||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||
<image :src="item.img"></image>
|
||||
{{item.title}}
|
||||
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
style="float: right;margin-top: 5rpx;"></u-radio>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="width: 100%;" v-else>
|
||||
<view v-for="(item, index) in iosPaylist" @click="choseType(item.id)"
|
||||
:class="payType == item.id?'Tab_xf cf_xuanx':'cf_xuanx'">
|
||||
<image :src="item.img"></image>
|
||||
{{item.title}}
|
||||
<u-radio :key="index" activeColor="#fe6e09" :name='item.id'
|
||||
style="float: right;margin-top: 5rpx;"></u-radio>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="agree_wo flexbox" style="float: left; display: flex;">
|
||||
<radio-group class="agree">
|
||||
<view v-for="(item, index) in argee" :key="index">
|
||||
<radio class="agreeRadio" :value="item.id" :checked="item.id==radioValue"
|
||||
@click="radioCheck(index)"></radio>
|
||||
|
||||
</view>
|
||||
</radio-group>
|
||||
<view>* 我已阅读并同意<span class="highlight" @click="showXieyi">《增值服务协议》</span></view>
|
||||
</view>
|
||||
<view class="char_btn">
|
||||
|
||||
<view @click="goToPay">立即充值</view>
|
||||
|
||||
<!-- <view @click="iosPay" >立即充值</view> -->
|
||||
|
||||
</view>
|
||||
<!-- 充值协议 -->
|
||||
<u-popup :show="xieyiShow" :round="10" @close="xieyiShow=false">
|
||||
<view class="tanchu">
|
||||
<view class="dp_title">{{xieyi.title}}</view>
|
||||
<view style="max-height: 1000rpx;overflow-y: scroll;">
|
||||
<view v-html="xieyi.content"></view>
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
checkIapOrder
|
||||
} from '@/store/modules/common.js';
|
||||
// import { // 引入ios支付
|
||||
// Iap,
|
||||
// IapTransactionState
|
||||
// } from "@/utils/iap.js"
|
||||
import {
|
||||
mapState,mapMutations
|
||||
} from 'vuex';
|
||||
import {
|
||||
setPay,
|
||||
setPayAssign,setWXPay
|
||||
} from '@/config/utils';
|
||||
// const IAPOrders = [ // 根据这些ids获取到苹果app内商品信息,这些ids就是你上面设置的产品id
|
||||
// 'add69'
|
||||
// ]
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
xieyi: {
|
||||
title: '',
|
||||
content: ''
|
||||
},
|
||||
chargeOrderSn:'', // 通过query传过来的orderSN(二次支付情况)
|
||||
xieyiShow: false,
|
||||
stepsCj: {},
|
||||
cjList: [],
|
||||
argee: [{
|
||||
value: false,
|
||||
id: '1'
|
||||
}
|
||||
|
||||
], // 同意权限
|
||||
radioValue: '',
|
||||
orderSn: '', // 订单sn
|
||||
productid: '',
|
||||
isAndroid: true, // 是否为安卓环境
|
||||
|
||||
payType: 2,
|
||||
// #ifdef APP-IOS
|
||||
payType: 3,
|
||||
// #endif
|
||||
paylist: [{
|
||||
title: '支付宝',
|
||||
id: 2,
|
||||
img: '../../static/icon/pay_1.png'
|
||||
},
|
||||
{
|
||||
title: '微信',
|
||||
id: 1,
|
||||
img: '../../static/icon/pay_2.png'
|
||||
}
|
||||
],
|
||||
iosPaylist: [{
|
||||
title: 'apple pay支付',
|
||||
id: 3,
|
||||
img: '../../static/icon/pay_2.png'
|
||||
}],
|
||||
transaction: { // 成功回调
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.chargeOrderSn = e.orderSn
|
||||
// console.log(e.orderSn,'orderSn')
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
// this.iphonepay()
|
||||
uni.hideTabBar();
|
||||
this.getDevName()
|
||||
// setTimeout(()=>{
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/user/persCount'
|
||||
// })
|
||||
// },2000)
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
...mapMutations(['setUserInfo']),
|
||||
// 关闭交易订单
|
||||
finishTransaction(trans){
|
||||
this.iapChannel.finishTransaction(trans, (success) => {
|
||||
console.log('关闭订单成功');
|
||||
this.setUserInfo({restoreFlag:false});
|
||||
}, (fail) => {
|
||||
console.log('关闭订单失败');
|
||||
});
|
||||
},
|
||||
showXieyi() {
|
||||
this.$http
|
||||
.get(`sys/agreement/list?key=pay`)
|
||||
.then(res => {
|
||||
this.xieyi = res.page.list[0]
|
||||
this.xieyiShow = true
|
||||
})
|
||||
|
||||
},
|
||||
radioCheck(index) { // 勾选用户协议
|
||||
this.argee.forEach((item => {
|
||||
item.isCheck = false
|
||||
}))
|
||||
if (this.radioValue == this.argee[index].id) {
|
||||
this.radioValue = null
|
||||
} else {
|
||||
this.radioValue = this.argee[index].id
|
||||
}
|
||||
// console.log(this.radioValue)
|
||||
},
|
||||
iphonepay() {
|
||||
const that = this
|
||||
// 如果ios已经绑定支付信息,就直接支付,如果没有绑定,就需要先绑定
|
||||
console.log('检测支付环境...')
|
||||
plus.payment.getChannels((channels) => {
|
||||
console.log(channels, 'channels')
|
||||
for (var i in channels) {
|
||||
// 判断是否苹果支付1
|
||||
if (channels[i].id === 'appleiap') {
|
||||
that.iapChannel = channels[i]
|
||||
that.requestOrder()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
requestOrder() {
|
||||
uni.showLoading({
|
||||
title: '获取商品信息',
|
||||
mask: true
|
||||
})
|
||||
const that = this
|
||||
console.log(that.stepsCj.priceTypeId, 88888888)
|
||||
// ['xxxxx'] 是平台申请拿到的内购商品的id
|
||||
let IAPOrders = []
|
||||
IAPOrders.push(that.stepsCj.priceTypeId+'')
|
||||
console.log(IAPOrders, 'IAPOrders')
|
||||
// 新建订单
|
||||
that.iapChannel.requestOrder(IAPOrders, function(event) {
|
||||
// uni.hideLoading()
|
||||
console.log(event, 'event')
|
||||
for (var index in event) {
|
||||
var OrderItem = event[index]
|
||||
// console.log(OrderItem, 'OrderItem')
|
||||
console.log(OrderItem.productid,'OrderItem.productid')
|
||||
that.topay(OrderItem.productid)
|
||||
}
|
||||
}, function(erroemsg) {
|
||||
uni.showToast({
|
||||
title: "商品获取失败",
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
},
|
||||
topay(id) {
|
||||
const that = this
|
||||
uni.hideLoading()
|
||||
// if(this.chargeOrderSn != '' || this.chargeOrderSn != undefined){ // 判断是不是二次支付的订单
|
||||
// that.orderSn = this.chargeOrderSn
|
||||
// console.log(that.orderSn,'二次支付的订单号')
|
||||
// }
|
||||
// var restoreFlag = true; // 调用支付接口时标记 restoreFlag = true , 实际应用请将标记存储在 storage 中
|
||||
this.setUserInfo({restoreFlag:true});
|
||||
console.log(this.userInfo,'更新后的用户信息')
|
||||
plus.payment.request(that.iapChannel, {
|
||||
productid: id,
|
||||
username: that.orderSn, // 用户标识/订单标识
|
||||
manualFinishTransaction: true // 3.5.1+ 支持,设置此参数后需要开发者主动关闭订单,参见下面的关闭订单方法 finishTransaction()
|
||||
|
||||
}, function(result) {
|
||||
// restoreFlag = false; // 支付成功清除标记 restoreFlag = false
|
||||
that.transaction = result
|
||||
// 支付成功,result 为 IAP商品交易信息对象 IAPTransaction 需将返回的支付凭证传给后端进行二次认证
|
||||
that.iapCheck(result)
|
||||
}, function(e) {
|
||||
console.log('错误回调', e)
|
||||
if(e.errCode == 2){
|
||||
// 用户未绑定支付方式,app内支付流程结束,系统弹出框引导用户绑定支付方式,此过程将跳转到系统应用 AppStore 进行绑定支付方式,绑定成功同步支付成功,用户成功付款
|
||||
plus.runtime.openURL("https://apps.apple.com/account/billing");
|
||||
}else{
|
||||
// restoreFlag = false; // 支付失败清楚标记
|
||||
that.finishTransaction(result);
|
||||
//console.log('订单关闭后的用户信息', that.userInfo);
|
||||
console.log(e)
|
||||
//console.log(e.message)
|
||||
}
|
||||
});
|
||||
},
|
||||
iapCheck(result) {
|
||||
let that = this
|
||||
console.log('进入后台验证')
|
||||
let data = {
|
||||
transactionId: result.transactionIdentifier, // 支付交易id
|
||||
customerOid: that.userInfo.id,
|
||||
productId: result.payment.productid, // 产品id
|
||||
orderId: result.payment.username, // 系统订单号
|
||||
receiptData: result.transactionReceipt ,// 苹果返回收据
|
||||
// body: that.stepsCj.priceTypeId // 充值类型id
|
||||
}
|
||||
console.log(data,'data')
|
||||
$http.request({
|
||||
url: "/Ipa/veri",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(JSON.stringify(res))
|
||||
if(res.code == 0){
|
||||
//uni.hideLoading()
|
||||
that.userInfo.restoreFlag == true ? that.setUserInfo({restoreFlag:false}) : ''
|
||||
console.log(that.userInfo.restoreFlag)
|
||||
console.log('充值订单已处理,请留意账户金额变动....')
|
||||
// 服务器验证票据有效后在客户端关闭订单 (iapChannel.finishTransaction)
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
}).catch(e => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
showCancel:false,
|
||||
content: '支付验证失败,请稍后重启app,如不能解决您的问题,可联系官方客服',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getDevName() {
|
||||
// 获取使用环境
|
||||
if (uni.getSystemInfoSync().platform === 'android') {
|
||||
this.isAndroid = true
|
||||
// console.log('运行Android上')
|
||||
} else {
|
||||
this.isAndroid = false
|
||||
// console.log('运行iOS上')
|
||||
}
|
||||
this.getData();
|
||||
},
|
||||
// 获取充值金额
|
||||
getData() {
|
||||
// console.log(this.isAndroid)
|
||||
if(this.isAndroid){
|
||||
this.getAndorList()
|
||||
}else{
|
||||
this.getAppleList()
|
||||
}
|
||||
|
||||
},
|
||||
// 安卓充值列表
|
||||
getAndorList(){
|
||||
this.$http
|
||||
.post('book/bookbuyconfig/getVipOrPoint', {
|
||||
type: 'point',
|
||||
qudao: 'Android'
|
||||
})
|
||||
.then(res => {
|
||||
this.cjList = res.list
|
||||
this.stepsCj = res.list[0]
|
||||
});
|
||||
},
|
||||
// 苹果充值列表
|
||||
getAppleList(){
|
||||
this.$http
|
||||
.post('book/bookbuyconfig/getVipOrPoint', {
|
||||
type: 'point',
|
||||
qudao: 'IOS'
|
||||
})
|
||||
.then(res => {
|
||||
this.cjList = res.list
|
||||
this.stepsCj = res.list[0]
|
||||
});
|
||||
},
|
||||
// 点击充值金额
|
||||
chosPric(e) {
|
||||
this.stepsCj = e
|
||||
console.log(e)
|
||||
},
|
||||
|
||||
// 选择支付方式1
|
||||
choseType(e) {
|
||||
let that = this
|
||||
that.payType = e
|
||||
},
|
||||
//ios充值
|
||||
iosPay() {
|
||||
this.iphonepay()
|
||||
},
|
||||
// 充值
|
||||
goToPay(){
|
||||
this.kaiChar()
|
||||
},
|
||||
// 正常充值
|
||||
kaiChar() { // 常规充值
|
||||
if (this.radioValue == '1') {
|
||||
uni.showLoading({
|
||||
title: '支付中,请勿离开',
|
||||
icon: 'loading'
|
||||
})
|
||||
let that = this
|
||||
let data = {
|
||||
userId: that.userInfo.id, //下单人ID
|
||||
userPhone: that.userInfo.tel, //收货人手机号
|
||||
paymentMethod: that.payType, //2支付宝,1微信,3ios内购
|
||||
orderMoney: that.stepsCj.money * 1, //订单金额
|
||||
districtMoney: 0, //优惠金额
|
||||
realMoney: that.stepsCj.money * 1, //实收金额
|
||||
orderStatus: 0, //订单状态
|
||||
orderType: "point", //订单类型
|
||||
productId: that.stepsCj.priceTypeId // 充值的类型id
|
||||
}
|
||||
$http.request({
|
||||
url: "book/buyOrder/rechargeSave",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data,
|
||||
header: { //默认 无 说明:请求头1
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
that.orderSn = res.orderSn
|
||||
uni.hideLoading()
|
||||
if (res.code == 0) {
|
||||
if (that.payType == 2) {
|
||||
setPay({
|
||||
typePay: 'alipay',
|
||||
subject: 'point',
|
||||
totalAmount: that.stepsCj.money,
|
||||
type: that.payType,
|
||||
relevanceoid: res.orderSn,
|
||||
body: that.stepsCj.priceTypeId,
|
||||
}, res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/persCount'
|
||||
})
|
||||
},2000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
})
|
||||
} else if (that.payType == 1) {
|
||||
// 微信支付
|
||||
that.orderSn = res.orderSn
|
||||
let data1={
|
||||
orderSn:that.orderSn,
|
||||
buyOrderId: that.stepsCj.priceTypeId,
|
||||
totalAmount: that.stepsCj.money
|
||||
}
|
||||
console.log(data1,'data1')
|
||||
// console.log(this.userInfo.channelList,'channelList')
|
||||
// this.userInfo.channelList.map(item => {
|
||||
// if(item.id == "wxpay"){
|
||||
// console.log('支持微信支付')
|
||||
setWXPay(data1,res => {
|
||||
if (res.success) {
|
||||
uni.showToast({
|
||||
title: "支付成功"
|
||||
});
|
||||
setTimeout(()=>{
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/persCount'
|
||||
})
|
||||
},2000)
|
||||
} else {
|
||||
console.log(res)
|
||||
if(res.data.errMsg.indexOf('User canceled') != -1){
|
||||
uni.showToast({
|
||||
title: "用户取消支付",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
image: '../../static/icon/ic_close.png'
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
// }
|
||||
// })
|
||||
|
||||
} else if (that.payType == 3) {
|
||||
console.log('苹果支付', )
|
||||
that.iosPay()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请勾选 已阅读会员服务协议',
|
||||
icon: 'none'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 跳转
|
||||
onPageJump(url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.tanchu {
|
||||
padding: 40rpx 30rpx 40rpx 30rpx;
|
||||
position: relative;
|
||||
|
||||
|
||||
.dp_title {
|
||||
font-size: 32rpx;
|
||||
margin-bottom: 50rpx;
|
||||
color: #555;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dp_add {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
right: 30rpx;
|
||||
font-size: 22rpx;
|
||||
background-color: #fd6004;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
|
||||
.u-icon {
|
||||
display: inline-block;
|
||||
margin-right: 5rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.addressItem {
|
||||
border: 2px dashed #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
|
||||
.addrContent {
|
||||
margin-left: 40rpx;
|
||||
flex: 1;
|
||||
|
||||
.addrContentTop {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
margin: 0 0 15rpx 0;
|
||||
position: relative;
|
||||
|
||||
.userName {
|
||||
font-size: 35rpx;
|
||||
font-weight: bold;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
|
||||
.userTel {
|
||||
font-size: 25rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.userMoren {
|
||||
border: 1px solid #fd6004;
|
||||
color: #fd6004;
|
||||
padding: 3rpx 10rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 10rpx;
|
||||
margin: 0 0 0 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.chooseCheck {
|
||||
position: absolute;
|
||||
top: 3rpx;
|
||||
right: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.addrContentBottom {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.addressItem.addItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
|
||||
.youhuiItem {
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
padding: 20rpx 10rpx;
|
||||
margin: 25rpx 0 0 0;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.youhuiItem>view {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.youhuiItem.youItem_style {
|
||||
border-color: #fd6004;
|
||||
}
|
||||
}
|
||||
|
||||
.agreeRadio {
|
||||
zoom: .8;
|
||||
}
|
||||
|
||||
.cha_jine {
|
||||
margin: 40rpx 50rpx 0 50rpx;
|
||||
|
||||
.cj_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cj_xiang {
|
||||
margin-top: 50rpx;
|
||||
|
||||
.cj_price {
|
||||
box-shadow: 0 0 20rpx 0 #0000001a;
|
||||
float: left;
|
||||
width: 47%;
|
||||
margin: 0 30rpx 30rpx 0;
|
||||
text-align: center;
|
||||
padding: 25rpx 0 30rpx 0;
|
||||
border-radius: 20rpx;
|
||||
position: relative;
|
||||
color: #2d2d2d;
|
||||
|
||||
.pr_jg {
|
||||
font-size: 45rpx;
|
||||
margin: 20rpx 0 10rpx 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pr_yl {
|
||||
font-size: 30rpx;
|
||||
// text-decoration: line-through;
|
||||
color: #b1b1b1;
|
||||
}
|
||||
|
||||
.pr_lj {
|
||||
background-image: linear-gradient(90deg, #fe6e09 0%, #efa574 100%);
|
||||
color: #fff;
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 0;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 10rpx;
|
||||
border-top-left-radius: 20rpx;
|
||||
border-bottom-right-radius: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cj_price:nth-child(2n) {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.Tab_cj {
|
||||
box-shadow: 0 0 20rpx 0 #fe700bcc;
|
||||
color: #7b4c0a;
|
||||
background: #fff9f5cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.highlight {
|
||||
color: $uni-color-primary;
|
||||
}
|
||||
|
||||
.cha_fangsh {
|
||||
margin: 40rpx 50rpx 0 50rpx;
|
||||
|
||||
.cf_title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cf_radio {
|
||||
margin-top: 20rpx;
|
||||
|
||||
.cf_xuanx {
|
||||
font-size: 32rpx;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1px solid #ededed;
|
||||
|
||||
image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
|
||||
.Tab_xf {
|
||||
background-color: #fdf1e9cc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.agree_wo {
|
||||
color: #aaa;
|
||||
font-size: 25rpx;
|
||||
margin-top: 30rpx;
|
||||
margin: 40rpx 50rpx 0 50rpx;
|
||||
padding-bottom: 180rpx;
|
||||
}
|
||||
|
||||
.char_btn {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 30rpx;
|
||||
|
||||
view {
|
||||
background-image: linear-gradient(90deg, #ed7161 0%, #efa574 100%);
|
||||
color: #fff;
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
font-size: 35rpx;
|
||||
font-weight: bold;
|
||||
padding: 25rpx 0;
|
||||
border-radius: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
331
pages/peanut/searchFor.vue
Normal file
331
pages/peanut/searchFor.vue
Normal file
@@ -0,0 +1,331 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar>
|
||||
<u-search :clearabled="true" bgColor="#fff" borderColor="#54a966" focus v-model="bookScreen.bookName"
|
||||
@custom='souBook' @clear="clear"></u-search>
|
||||
</z-nav-bar>
|
||||
<view class="sear_ch" v-if="this.show==0">
|
||||
<view class="sear_ch_tit">
|
||||
历史搜索
|
||||
</view>
|
||||
<view class="sear_ch_tag">
|
||||
<text v-for="item in historyList" @click="serkeyWord(item)">{{item}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="sear_class" v-if="this.show==1">
|
||||
<view class="sc_xuan">
|
||||
<view class="sc_con" v-for="(item,index) in classFen" @click="FenBook(item)"
|
||||
:class="bookScreen.type == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
|
||||
</view>
|
||||
<view class="sc_xuan">
|
||||
<view class="sc_con" v-for="(item,index) in classMian" @click="MianBook(item)"
|
||||
:class="bookScreen.is_charge == item.id ? 'sc_con sc_con_style' : 'sc_con'">{{item.sort}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="sear_list" v-if="this.show==1">
|
||||
|
||||
<view class="flexbox" style="display: flex; flex-wrap: wrap; justify-content: space-evenly;">
|
||||
<view class="bl_tioa" v-for="(item,index) in bookList" @click="onBookJump(item)">
|
||||
<image :src="item.productImages"></image>
|
||||
<view>
|
||||
<text class="bok_name">{{item.productName}}</text>
|
||||
</view>
|
||||
<!-- <view>
|
||||
<text>作者:<text style="color: #333;">{{item.authorName}}</text></text>
|
||||
</view>
|
||||
<view>
|
||||
<text>出版商:<text style="color: #333;">{{item.publisherName}}</text></text>
|
||||
</view>
|
||||
<view>
|
||||
<text style="line-height: 20rpx;">{{item.title}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="height: 1px;"></view>
|
||||
<view>
|
||||
<view v-if="status==0" style="text-align: center;">
|
||||
<u-loading-icon style="display: inline-block;"></u-loading-icon>
|
||||
<font style='vertical-align: super;margin-left: 10px;font-size: 26rpx;color: #909399;'>努力加载中</font>
|
||||
</view>
|
||||
<view v-if="status==1">
|
||||
<u-divider text="全部加载完成"></u-divider>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view style="padding-bottom: 20rpx;">
|
||||
<u-back-top :scroll-top="scrollTop"></u-back-top>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="this.show==1&&this.bookList==''">
|
||||
<u-divider text="暂无数据"></u-divider>
|
||||
</view>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
scrollTop: 0,
|
||||
totalPage: 0,
|
||||
status: 3,
|
||||
show: 0,
|
||||
bookList: [],
|
||||
historyList: [],
|
||||
bookScreen: {
|
||||
authorName: '', //作者
|
||||
publisherName: '', //出版社
|
||||
type: '', //电子书类型
|
||||
bookName: '', //关键词
|
||||
is_charge: 1, //是否收费(0收费1免费)
|
||||
state: 1,
|
||||
page: 1, //当前页码数
|
||||
limit: 10, //单页数据数量
|
||||
},
|
||||
classFen: [{
|
||||
sort: '全部',
|
||||
id: ''
|
||||
}, {
|
||||
sort: '医学',
|
||||
id: 1
|
||||
}, {
|
||||
sort: '国学',
|
||||
id: 2
|
||||
}, {
|
||||
sort: '文学',
|
||||
id: 3
|
||||
}, {
|
||||
sort: '古籍',
|
||||
id: 4
|
||||
}],
|
||||
classMian: [{
|
||||
sort: '免费',
|
||||
id: 1
|
||||
}, {
|
||||
sort: 'VIP',
|
||||
id: 0
|
||||
}],
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
// 返回顶部
|
||||
onPageScroll(e) {
|
||||
this.scrollTop = e.scrollTop;
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onReachBottom() {
|
||||
this.status = 0
|
||||
if (this.bookScreen.page < this.totalPage) {
|
||||
this.bookScreen.page = this.bookScreen.page + 1
|
||||
setTimeout(() => {
|
||||
this.$http
|
||||
// .post('book/book/list', this.bookScreen)
|
||||
.post('book/shopproduct/selectList?limit=8&page=1&key='+this.bookScreen.bookName)
|
||||
.then(res => {
|
||||
this.totalPage = res.page.totalPage
|
||||
for (let i in res.page.list) {
|
||||
this.bookList.push(res.page.list[i])
|
||||
}
|
||||
});
|
||||
}, 1000)
|
||||
} else {
|
||||
this.status = 1
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
this.getHistory()
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
// 获取缓存
|
||||
getHistory() {
|
||||
this.historyList = uni.getStorageSync('hisRecords')
|
||||
if (this.historyList.length > 10) {
|
||||
this.historyList.splice(10, this.historyList.length)
|
||||
uni.setStorageSync('hisRecords', this.historyList);
|
||||
}
|
||||
},
|
||||
|
||||
// 获取列表数据
|
||||
getData() {
|
||||
this.$http
|
||||
// .post('book/book/list', this.bookScreen)
|
||||
.post('book/shopproduct/selectList?limit=8&page=1&key='+ this.bookScreen.bookName)
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
this.bookList = res.page.list
|
||||
this.totalPage = res.page.totalPage
|
||||
this.status = 3
|
||||
this.show = 1
|
||||
});
|
||||
},
|
||||
|
||||
// 清空
|
||||
clear() {
|
||||
this.show = 0
|
||||
this.getHistory()
|
||||
},
|
||||
|
||||
// 搜索
|
||||
souBook() {
|
||||
if (this.bookScreen.bookName == '') {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '请输入关键字'
|
||||
})
|
||||
return
|
||||
}
|
||||
this.getData();
|
||||
|
||||
let ArryList = []
|
||||
if (uni.getStorageSync('hisRecords') == '') {
|
||||
ArryList.push(this.bookScreen.bookName)
|
||||
uni.setStorageSync('hisRecords', ArryList);
|
||||
} else {
|
||||
let value = uni.getStorageSync('hisRecords')
|
||||
value.unshift(this.bookScreen.bookName)
|
||||
uni.setStorageSync('hisRecords', value);
|
||||
}
|
||||
},
|
||||
|
||||
// 点击历史搜索
|
||||
serkeyWord(e) {
|
||||
this.bookScreen.bookName = e
|
||||
this.getData();
|
||||
},
|
||||
|
||||
// 分类选择
|
||||
FenBook(e) {
|
||||
if (e.id == 0) {
|
||||
this.bookScreen.type = ''
|
||||
} else {
|
||||
this.bookScreen.type = e.id
|
||||
}
|
||||
this.bookScreen.page = 1
|
||||
this.getData();
|
||||
},
|
||||
MianBook(e) {
|
||||
this.bookScreen.is_charge = e.id
|
||||
this.bookScreen.page = 1
|
||||
this.getData();
|
||||
},
|
||||
|
||||
// 电子书内容跳转
|
||||
onBookJump(e) {
|
||||
console.log(e,'e')
|
||||
uni.navigateTo({
|
||||
// url: '../eBook/bookContent?Id=' + e.id
|
||||
url: '../bookShop/commodityDetail?type=2&id=' + e.productId
|
||||
});
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.sear_ch {
|
||||
margin: 50rpx 40rpx 0 40rpx;
|
||||
|
||||
.sear_ch_tit {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 0 0;
|
||||
}
|
||||
|
||||
.sear_ch_tag {
|
||||
margin: 20rpx 0 0 0;
|
||||
|
||||
text {
|
||||
background-color: #eee;
|
||||
font-size: 24rpx;
|
||||
border-radius: 50rpx;
|
||||
display: inline-block;
|
||||
margin: 0 30rpx 20rpx 0;
|
||||
padding: 10rpx 25rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sear_class {
|
||||
margin: 20rpx 30rpx 60rpx 30rpx;
|
||||
|
||||
.sc_xuan {
|
||||
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.sc_con {
|
||||
display: inline-block;
|
||||
font-size: 28rpx;
|
||||
margin-right: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
}
|
||||
|
||||
.sc_con_style {
|
||||
color: #27b386;
|
||||
background-color: #2ab58833;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sear_list {
|
||||
margin: 50rpx 30rpx 0 30rpx;
|
||||
// justify-content: space-between;
|
||||
|
||||
.bl_tioa {
|
||||
width: 30%;
|
||||
box-shadow: 0 0px 10px 1px #d3d1d133; padding-bottom: 10rpx;
|
||||
background-color: #fff; margin-bottom: 20rpx;
|
||||
// position: relative;
|
||||
// padding: 0 25upx 10upx 220upx;
|
||||
// margin: 0 0 60rpx 0;
|
||||
text-align: center;
|
||||
border-radius: 15rpx;
|
||||
min-height: 250rpx;
|
||||
|
||||
view {
|
||||
display: block;
|
||||
text { display: block;
|
||||
color: #9b9b9b;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
.bok_name {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
image { display: inline-block;
|
||||
padding-top:20rpx;
|
||||
width: 160upx;
|
||||
height: 220upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
362
pages/peanut/shopping.vue
Normal file
362
pages/peanut/shopping.vue
Normal file
@@ -0,0 +1,362 @@
|
||||
<template>
|
||||
<view>
|
||||
<z-nav-bar backState="2000" title="购物车"></z-nav-bar>
|
||||
<view class="shopCarContent">
|
||||
<scroll-view scroll-y="true">
|
||||
<view class="cartItem" v-for="(item,index) in cartList" :key="index">
|
||||
<view class="select">
|
||||
<checkbox :checked="item.checked" @click="checkboxGroupChange(index,item)"
|
||||
class="round checkedItem" />
|
||||
</view>
|
||||
<view class="cartContent">
|
||||
<image :src="item.image" mode="" @click="goDetail(item.productId)"></image>
|
||||
<view class="itemCenter">
|
||||
<view class="cartTitle" @click="goDetail(item.productId)">
|
||||
<text>{{item.productName}}</text>
|
||||
</view>
|
||||
<view class="itemPrice">
|
||||
<text v-if="item.activityPrice && item.activityPrice > 0">¥{{item.activityPrice*item.productAmount}}</text>
|
||||
<text v-else>¥{{item.price*item.productAmount}}</text>
|
||||
<u-number-box v-model="item.productAmount" @change="valChange($event,item)" :input-width="50"
|
||||
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<!-- 底部操作区 -->
|
||||
<view class="shopCarFooter">
|
||||
<view class="selectAll">
|
||||
<checkbox :checked="all" @click="isSelectAll()" class="round checkedItem" />
|
||||
<text class="cartCho">全选</text>
|
||||
<!-- <text class="cartDel" >删除</text> -->
|
||||
<button class="mini-btn" style="border-radius: 40rpx; font-size: 30rpx; height: 56rpx; line-height: 56rpx; margin-left: 6rpx;" v-if="isCartDelShow" @click="delCart()" type="warn" size="mini">删除</button>
|
||||
</view>
|
||||
<view class="exhibition">
|
||||
<text class="total">合计: <b>¥{{totalPrice}}</b></text>
|
||||
<view class="settlement" @click="setTment()">
|
||||
结算
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 公共组件-每个页面必须引入 -->
|
||||
<public-module></public-module>
|
||||
|
||||
<z-navigation></z-navigation>
|
||||
<music-play :playData="playData"></music-play>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import musicPlay from '@/components/music.vue'
|
||||
import $http from '@/config/requestConfig.js';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
playData:{},
|
||||
totalPrice: 0, // 总价
|
||||
all: false, // 是否全选
|
||||
isCartDelShow: false, // 是否展示删除按钮
|
||||
cartList: [] // 购物车列表
|
||||
};
|
||||
},
|
||||
//第一次加载
|
||||
onLoad(e) {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getCartList()
|
||||
},
|
||||
//页面显示
|
||||
onShow() {
|
||||
// 隐藏原生的tabbar
|
||||
uni.hideTabBar();
|
||||
this.getCartList();
|
||||
this.all = false;
|
||||
this.isCartDelShow = false
|
||||
this.totalPrice = 0
|
||||
},
|
||||
computed: {
|
||||
...mapState(['userInfo']),
|
||||
},
|
||||
components:{
|
||||
musicPlay
|
||||
},
|
||||
//方法
|
||||
methods: {
|
||||
// 获取购物车列表
|
||||
getCartList() {
|
||||
this.$http.post(`book/ordercart/getCartList?userId=${this.userInfo.id}`).then(res => {
|
||||
this.cartList = res.cartList
|
||||
if (res.cartList.length > 0) {
|
||||
res.cartList.forEach((item, index) => {
|
||||
item.checked = false
|
||||
})
|
||||
this.cartList = res.cartList
|
||||
}
|
||||
})
|
||||
},
|
||||
// 是否全选
|
||||
isSelectAll(e) {
|
||||
if (this.cartList.length > 0) {
|
||||
this.all = !this.all
|
||||
this.cartList.forEach((item, index) => {
|
||||
item.checked = this.all
|
||||
})
|
||||
this.isCartDelShow = this.all
|
||||
this.total()
|
||||
} else {
|
||||
this.all = false
|
||||
}
|
||||
},
|
||||
// 选中单独商品
|
||||
checkboxGroupChange(index, item) {
|
||||
// 修改当前item的checked
|
||||
this.cartList[index].checked = !item.checked
|
||||
// 判断是否全选
|
||||
this.all = this.cartList.every((item, index) => {
|
||||
return item.checked == true
|
||||
})
|
||||
// 判断是否展示删除按钮
|
||||
this.isCartDelShow = this.cartList.some((item, index) => {
|
||||
return item.checked == true
|
||||
})
|
||||
// 计算总价
|
||||
this.total()
|
||||
},
|
||||
// 计算总价
|
||||
total() {
|
||||
let allprice = 0;
|
||||
this.cartList.forEach((item, index) => {
|
||||
let price = 0;
|
||||
if (item.checked) {
|
||||
if(item.activityPrice && item.activityPrice > 0){
|
||||
price = item.productAmount * item.activityPrice;
|
||||
}else{
|
||||
price = item.productAmount * item.price;
|
||||
}
|
||||
}
|
||||
allprice += price
|
||||
})
|
||||
this.totalPrice = allprice
|
||||
},
|
||||
// 超出阈值时
|
||||
overlimit(){
|
||||
uni.showToast({
|
||||
title:'超出商品数量',
|
||||
icon: 'error',
|
||||
duration: 1000
|
||||
})
|
||||
},
|
||||
valChange(e, item) {
|
||||
console.log(e)
|
||||
let productItem = {}
|
||||
productItem = item
|
||||
productItem.productAmount = e.value
|
||||
this.updateCart(productItem)
|
||||
setTimeout(() => {
|
||||
this.total()
|
||||
}, 300)
|
||||
},
|
||||
// 更新购物车
|
||||
updateCart(shagnpin){
|
||||
// 已在购物车中添加
|
||||
$http.request({
|
||||
url: "book/ordercart/update",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: shagnpin,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
// uni.showToast({
|
||||
// title: '加入购物车成功',
|
||||
// duration: 1000,
|
||||
// });
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除购物车
|
||||
delCart() {
|
||||
let cartIdArr = [];
|
||||
this.cartList.forEach((item, index) => {
|
||||
if (item.checked) {
|
||||
cartIdArr.push(item.cartId)
|
||||
}
|
||||
})
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否删除这个商品',
|
||||
confirmText: '确定',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
console.log(cartIdArr)
|
||||
$http.request({
|
||||
url: "book/ordercart/delete",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: cartIdArr,
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
this.isCartDelShow = false
|
||||
this.totalPrice = 0
|
||||
this.getCartList()
|
||||
uni.hideLoading()
|
||||
})
|
||||
} else {
|
||||
console.log('cancel') //点击取消之后执行的代码
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转结算页面
|
||||
setTment() {
|
||||
let shangList=[]
|
||||
this.cartList.forEach((item, index) => {
|
||||
if (item.checked) {
|
||||
shangList.push(index)
|
||||
}
|
||||
})
|
||||
// 如果没有勾选
|
||||
if(shangList.length == 0){
|
||||
uni.showToast({
|
||||
title: "请先勾选商品",
|
||||
icon: 'error',
|
||||
duration: 1000,
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/settlement?type=1&list='+JSON.stringify(shangList)
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 商品内容跳转
|
||||
goDetail(id) {
|
||||
uni.navigateTo({
|
||||
url: '../bookShop/commodityDetail?id=' + id
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import '@/style/mixin.scss';
|
||||
|
||||
.shopCarContent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding-bottom: 104rpx;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.cartItem {
|
||||
padding: 10rpx 10rpx 10rpx 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
|
||||
.cartContent {
|
||||
|
||||
flex: 1;
|
||||
display: flex;
|
||||
|
||||
image {
|
||||
width: 150rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 10rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.itemCenter {
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.cartTitle {
|
||||
font-size: 30rpx;
|
||||
margin: 35rpx 0 20rpx 0;
|
||||
}
|
||||
|
||||
.itemPrice {
|
||||
font-size: 28rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.shopCarFooter {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
position: fixed;
|
||||
bottom: 110rpx;
|
||||
|
||||
.selectAll {
|
||||
|
||||
display: flex;
|
||||
|
||||
|
||||
.cartCho {
|
||||
margin-top: 12rpx;
|
||||
font-size: 25rpx;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.cartDel {
|
||||
font-weight: bold;
|
||||
color: #bf0c0c;
|
||||
font-size: 14px;
|
||||
margin: 12rpx 0 0 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.exhibition {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.total {
|
||||
font-size: 15px;
|
||||
padding: 0 40rpx 0 0;
|
||||
color: #888;
|
||||
|
||||
b {
|
||||
margin-left: 10rpx;
|
||||
color: #e97512;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.settlement {
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
padding: 10rpx 50rpx;
|
||||
background-image: linear-gradient(90deg, #eba00b 0%, #c96713 100%);
|
||||
color: #fff;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user